Re: getch() for non-windows systems?
Posted: Sat Oct 09, 2010 11:38 am
Is there a reason you can't just read in a char?
Code: Select all
char c;
std::cin >> c;
The Next Generation of 2D Roleplaying Games
http://elysianshadows.com/phpBB3/
Code: Select all
char c;
std::cin >> c;
getchar() reads a single character from stdin. However, what you may want to do is something like this:IMNEW11 wrote:That's C++, im looking for C..
and i want it to be multi-platform.
Code: Select all
while(getchar() != '\n');
I don't know of any alternative that would work on all systems without #IFDEFs.IMNEW11 wrote:That's C++, im looking for C..
and i want it to be multi-platform.