Hello!
How can I convert an integer to it's associated character?
For instance the value "27" stands for the "ESC-Key", "97" stand for "a" and so on.
Thank you,
Hello!
How can I convert an integer to it's associated character?
For instance the value "27" stands for the "ESC-Key", "97" stand for "a" and so on.
Thank you,
Chars are just small integers, so
ch = 'a';
ch = 97; // assuming ASCII
are the same thing.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
ok. but I am not completely sure how to use it.
I want to do a sort of key-mapping. Therefore on the one hand I get the key as a const char* which I want to convert to the associated ASCII number.
But I also want to do this in the other direction so that I get a char* representation of the ASCII code.
[EDIT]: I got it .
Another question: how can I convert a char* to a ASCII code?
(e.g. "a" => 97).
Last edited by pixsta; 04-14-2006 at 02:27 AM.
Thank you. I finally got all working.