Trying to write a C or C++ program on linux that exits with a keypress
by Al99 from LinuxQuestions.org on (#59X6T)
Hi all, I'm new to programming and I'm new to linux and I've been experimenting with c++ and enjoying it. I'm coming up against a bit of a dead end though when trying to write a c++ program that exits a loop and shuts down the program in the terminal when a key is pressed, say escape or 'q' for example, I tried getch but it didn't work and the only other thing that was suggested was to embed assembler which I couldn't find any information about, so there it is, can anyone advise me how to make a c++ program that exits on a keypress in linux? Thanks.

