Monday, May 24, 2010

ASCII values on Visual C++?

what is the typecast/ command for finding the ASCII values on VC++

ASCII values on Visual C++?
1)casting: always works.


char a='A';


int b=(int)a;


2)Only for chars and integers this works:


char a='A';


int b=a;


3)even this works:


char a=128;





I know in some low level languages(like pascal) there are functions to do this, but not in C/C++
Reply:its very easy to find ascii value,get value from char,and print it into int.


like


char a='A';


printf("Ascii value of %c is %d",a,a);


No comments:

Post a Comment