KEY_ENTER vs '\n'?

Posted by wrongusername on Stack Overflow See other posts from Stack Overflow or by wrongusername
Published on 2010-06-03T04:27:55Z Indexed on 2010/06/03 4:34 UTC
Read the original article Hit count: 328

Filed under:
|
|
|

When I'm using PDcurses and I try to have a while loop exit when the enter key is pressed with while(key != KEY_ENTER), the while loop never exits. However, when I try to have the same loop exit with while((char)key != '\n'), it exits successfully whenever I pressed enter. What's the difference?

© Stack Overflow or respective owner

Related posts about c++

Related posts about newline