Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

steelphantom

macrumors 6502a
Original poster
Oct 15, 2005
555
1
Right now I'm working on a simple C++ maze program and I want to clear the screen and redraw the maze every time the user makes a move. I know on Windows there is the system("cls") function (or something like that) that does this, but I couldn't find an equivalent that will work with my compiler on OS X. I tried clrscr(); but I got an error that it wasn't declared within my header file. Do I just need to include another header file, or is there a completely different function that does this?
 

pknz

macrumors 68020
Mar 22, 2005
2,478
1
NZ
What header files do you have?
I think these are needed, not sure which one in particular...

#include <conio.h>
#include <iostream.h>
#include <stdlib.h>
#include <fstream.h>
 

bousozoku

Moderator emeritus
Jun 25, 2002
16,120
2,397
Lard
I could swear this issue was recently discussed and resolved. Perhaps, a search of the forum would help.
 

steelphantom

macrumors 6502a
Original poster
Oct 15, 2005
555
1
bousozoku said:
I could swear this issue was recently discussed and resolved. Perhaps, a search of the forum would help.

Yep. Got it. system("clear"); should work. I didn't recall reading a thread about this before, but I just did a search, and BAM! there it was! :eek:
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.