# C++: clrscr() and getch() ?



## shad0w (Jan 12, 2004)

Hi folks,

I'm seeking for an unix/osx replacement for getch() and clrscr()?

any ideas?

thanks a lot


----------



## cfleck (Jan 12, 2004)

umm, what do they do?


----------



## shad0w (Jan 12, 2004)

clrscr() clears the console screen and getch() is an input function for one single character ...


----------



## cfleck (Jan 12, 2004)

try this fro getch

http://www.mcsr.olemiss.edu/cgi-bin/man-cgi?getch+3

i dont know about a clear screen function.  i vaguely remember doing using something to do just that back in the day, but i have no idea what.  for what its worth, you could just issue the system command maybe?


----------



## havic (Jan 12, 2004)

Well, there is a getch() function on Mac OS X, just do a man on it.  I imagine it will be the same as whatever you used on windows/linux/whatever.  To clear the screen, use system("clear"); which will execute the unix clear command, and clear the current screen.


----------

