Posts: 421
Threads: 22
Joined: Oct 2005
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
Posts: 691
Threads: 5
Joined: Apr 2002
You don't need to convert, just use a char:
Code:
char c = 65;
printf("c = %c\n", c);
Will print:
esus saves.... Passes to Moses, shoots, he scores!
Posts: 421
Threads: 22
Joined: Oct 2005
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
Posts: 691
Threads: 5
Joined: Apr 2002
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!
Posts: 421
Threads: 22
Joined: Oct 2005
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