char types

int a = 1; a++;
and now a would be 2.

the question is i get it how an int or other numerical types of datas increases and if:
char a = 'x'; a++;
a would be 'y'. but how. is it because alphabetic placement is stored in C or somewhere in the OS why??

and also when i think about it. i started to think about "do numbers stored according to numerical placment in somewhere too?"
Last edited on
Look up the ascii table, that's the common order.
If you go on another OS, they may have another ASCII table.

http://www.asciitable.com/
thx and i dont know why but it comes to me funny. they were stored haha. i thought it was something about calculating according to ahhh. whatever
thx again
Nah, they're not calculated.

Actually...

1
2
char a = 'x';
int b = a;


...According to the Ascii Table, b is now 120 (0x78 in hex).
Simply, a is storing a very small number, which ranges from 0 to 255, and it is commonly used to store english (latin?) characters, as they simply fit.
hmph. that was pretty informative(2^8) ty
Topic archived. No new replies allowed.