LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ASCII CODES CVI

How to convert in labWindows\cvi a caracter in its ascii code, example A = 41
0 Kudos
Message 1 of 2
(3,263 Views)
That's a generic C question not a CVI one.

Here are some examples:

char myAsciiChar;
int intValueOfASCII;
char StringRepresentationOfintValueOfASCII[3];
char StringRepresentationOfhexaValueOfASCII[3];

myAsciiChar='A';

//ASCII => Int
intValueOfASCII=(unsigned char) myAsciiChar;

//ASCII => int in a string
sprintf(StringRepresentationOfintValueOfASCII,"%d",(unsigned char) myAsciiChar);

//ASCII => Hexa in a string
sprintf(StringRepresentationOfhexaValueOfASCII,"%X",(unsigned char) myAsciiChar);
0 Kudos
Message 2 of 2
(3,263 Views)