But it white 1 second for me. But instead cleanscreen it prints:
TERM environment variable not set.
15
TERM environment variable not set.
14
TERM environment variable not set.
13
TERM environment variable not set.
12
TERM environment variable not set.
11
TERM environment variable not set.
10
TERM environment variable not set.
9
TERM environment variable not set.
8
TERM environment variable not set.
7
TERM environment variable not set.
6
TERM environment variable not set.
5
TERM environment variable not set.
4
TERM environment variable not set.
3
TERM environment variable not set.
2
TERM environment variable not set.
1
TERM environment variable not set.
0
BOOM
Ah, I did not noticed MacOS in your post. Well, the problem is that your OS/compiler/IDE does not initialise TERM variable. You need either run your program from proper terminal, or scratch system (which you should avoid anyway) and use some library or platform dependend solution.
Like here: http://stackoverflow.com/questions/9348153/clear-screen-in-xcode
You can work around this issue by selecting you executable in XCode in the Groups & Files side bar, clicking Info and then the Arguments tab. Here add an environment varaible called TERM with the value xterm-color.
However it is not guaranteed to work.
2) You can run from promer terminal and not Xcode pseudo-terminal. Just launch terminal, navigate to compiled program and run it.
But now it shows an error message "Conversion from string literal to 'char *' is deprecated" in 11 line and "No matching function for call to 'ClearScreen'" in 22 line.