Ascii value of ENTER key

Jul 22, 2011 at 11:53am
Hi,
I would like to print "You have pressed Enter key" when ever user hits Enter Key.
Please help me write this in C Program.

Can this happen using getch or getch of ncurses library too.

Regards,
Kiran.
Jul 23, 2011 at 1:34am
ENTER is a newline character, so '/n' can be used. To get the ascii value:
 
cout << int('\n');
Last edited on Jul 23, 2011 at 5:58pm
Jul 23, 2011 at 6:32am
of course it's '\n', not '/n'
Jul 23, 2011 at 5:58pm
Oops:) Thats what happens when its late and you ran out of mountain dew...
Jul 23, 2011 at 6:08pm
i found the solution already... but in a different way. Thanks
Topic archived. No new replies allowed.