Clear screen instruction

I use Dev-C++ compiler in Windows, and I want to use the clear screen instruction.
I've tried the <conio.h> getchar(); and the <stdlib.h> system("clear"); instructions and doesn't work.

More specific, the getchar(); doesn't work because the compiler doesn't know the instruction and the system("clear"); at the time of compiling it's all right, but when I open the .exe appears a message that doesn't what to do with that instruction, the rest of the program works but it's only that part.

Greetings and thanks in advance! :D
Last edited on
I didnt really get your question but ill try my best to help you :p
I think you're trying to clear the console?
In that case use:
cout << string( 100, '\n' );
In few words, I'm searching for a clear screen instruction.
No clrscr; or system("clear");, none of these works.

That code that you gave me is in <iostream.h> library?
And that \n is from <stdio.h> library right of just <iostream.h>?
Last edited on
Yess i believe so
Make sure to put using namespace std; at the top of your program or just use std::cout << string( 100, '\n' );
Last edited on
Man, but what "string( 100," means?
And why has a line leap?

Sorry for bothering but I'm curious. s:
string(100, '\n') is just calling the constructor of string 100 times containing '\n' (new line)
I have no idea what you mean with your 2nd question
Sorry im not very good at explaining :p
You mean that the instruction is like \n but 100 times, right?
In the second question I mean a new line, I call line leap, sorry.
Yeahh it prints out a new line 100 times
And there is no real way to clear the console so thats just a work around i guess
That is what you meant right ?
Yeah, but that instruction isn't for clearing screen, just printing a new line 100 times.
But I finally got it, thanks again dude!
Topic archived. No new replies allowed.