Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CHR$() equivalent in C
#1
What is it? I'm trying to write a program which adds some specific ascii codes to a string.
In the beginning, there is darkness – the emptiness of a matrix waiting for the light. Then a single photon flares into existence. Then another. Soon, thousands more. Optronic pathways connect, subroutines emerge from the chaos, and a holographic consciousness is born." -The Doctor
Reply
#2
You don't need to convert, just use a char:
Code:
char c = 65;
printf("c = %c\n", c);
Will print:
Code:
c = A
esus saves.... Passes to Moses, shoots, he scores!
Reply
#3
Can I do that with strcat? I'm trying to make a string to print to the system with system().
In the beginning, there is darkness – the emptiness of a matrix waiting for the light. Then a single photon flares into existence. Then another. Soon, thousands more. Optronic pathways connect, subroutines emerge from the chaos, and a holographic consciousness is born." -The Doctor
Reply
#4
You may be better using sprintf, or if you are using Linux and don't mind your code being unportable you can use asprintf.
esus saves.... Passes to Moses, shoots, he scores!
Reply
#5
Actually it's Knoppix. And it's someone else's system, but we won't g there right now....
In the beginning, there is darkness – the emptiness of a matrix waiting for the light. Then a single photon flares into existence. Then another. Soon, thousands more. Optronic pathways connect, subroutines emerge from the chaos, and a holographic consciousness is born." -The Doctor
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)