I got some problems writing my snake game program. I need to make game working on linux and windows. I found some topics how to clear screen on linux and windows using the
C89 does not have terminal handling functions. Instead, you should use OS specific functions. So you need to have, say, a source file only for windows functions and another for linux. Another option is to use a cross platform library. I would choose ncurses for this task:
http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/
It works on any unix system, including linux and Mac OS. For windows versions, see:
Is ncurses available for windows?
With ncurses, you have functions like erase() and clear() to clear the screen.