Background
Im trying to determine character codes for some national diactric letters.
Problem
Is something is wrong with my code?
char a = "a"; // "a" ascii code is 97
char buffer[8];
itoa(buffer,(int)a, 10);
print(buffer); // but it prints "252" instead of "97"
The character code for 'a'
is indeed 97, but "a"
is of type char *
. Single quotes '
encode characters, double quotes "
encode string literals.
Try
char a = 'a';