How to convert ASCII code to character [modified]
-
Hi All, I need to add the carriage return and line feed to a string to simulate the new line '\n' before writing it to a binary file. what is the function I can give the ASCII Code and it returns the equivalant character. What I need is a function that is similar to chr in Visual Basic -- modified at 8:17 Thursday 21st September, 2006
-
Hi All, I need to add the carriage return and line feed to a string to simulate the new line '\n' before writing it to a binary file. what is the function I can give the ASCII Code and it returns the equivalant character. What I need is a function that is similar to chr in Visual Basic -- modified at 8:17 Thursday 21st September, 2006
-
Hi All, I need to add the carriage return and line feed to a string to simulate the new line '\n' before writing it to a binary file. what is the function I can give the ASCII Code and it returns the equivalant character. What I need is a function that is similar to chr in Visual Basic -- modified at 8:17 Thursday 21st September, 2006
Mohsen Saad wrote:
Re: How to convert ASCII code to character
int i=10; //For Carriage return use 13 char *str=new char[3]; sprintf(str,"%c",i); cout<
Somethings seem HARD to do, until we know how to do them. ;-)**_AnShUmAn_**
-
Hi All, I need to add the carriage return and line feed to a string to simulate the new line '\n' before writing it to a binary file. what is the function I can give the ASCII Code and it returns the equivalant character. What I need is a function that is similar to chr in Visual Basic -- modified at 8:17 Thursday 21st September, 2006
Mohsen Saad wrote:
what is the function I can give the ASCII Code and it returns the equivalant character.
There is no need for that in C++. The ASCII code IS the character. That is:
char c1 = '\n'; // c1 = 10 char c2 = '\r'; // c2 = 13
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac