I\'m coding a program that reads data directly from user input and was wondering how could I read all data until ESC button on keyboard is pressed. I found only something li
I would suggest that for not just ESC character in C++, but for any other character of the keyboard in any language, read characters that you input into an integer variable and then print them as integer.
Either that or search online for a list of the ASCII characters.
This will give you ASCII value of the key, and then it's plain simple
if(foo==ASCIIval)
break;
For the ESC character, the ASCII value is 27.