I dont know how... Help...
G++ 2.96.
I dont know how... Help...
G++ 2.96.
Yoshi
I've always typed 'clear' at the command line. Hope this is the answer that you're looking for.
MS VC++ 6.0
In stdlib.h there is a function called system() which allows you to pass arguments to the shell. You use this injunction with the clear command for Bash like so:
Works the same for Windows Console only you use the cls command rather than clear.Code:system("clear");
Good luck
I usually use a preprocessor macro to save keystrokes later on....
i.e.
Code:#define CLEAR system("clear") //you can name clear anything, but it's usually good advice to with the actual system name.
MS VC++ 6.0
howdy,
system() calls are platform dependent and will cause great stress if you try to cross platforms with your code.
in console use a loop
void clrscrn()
{
for(int i = 0; i < 100; i++)
cout<<"\n";
}
it's a little messy but it will clear the screen and it is platform independent.
M.R.
I don't like you very much. Please post a lot less.
Cheez
*and then*
No, I know you were joking. My point still stands.
from the faq:
Code:#include <curses.h> void clrscr() { static int init; if (init == 0) { initscr(); init = 1; } clear(); refresh(); }
'During my service in the United States Congress, I took the initiative in creating the Internet.' - Al Gore, March 9, 1999: On CNN's Late Edition
works in linux only though.
#define clear printf("\033[2J\033[0;0f");
Works on any Terminal which supports vt100Originally posted by kwigibo
works in linux only though.
#define clear printf("\033[2J\033[0;0f");
>#define clear printf("\033[2J\033[0;0f");
nifty, how does it work?
'During my service in the United States Congress, I took the initiative in creating the Internet.' - Al Gore, March 9, 1999: On CNN's Late Edition
shaik786, wasn't aware of that fact. I know that they are "ANSI Escape Sequences", and I tried them in windows nt4, and didn't work so I assumed they only worked onl *nix systems (which supports vt100).
howdy,
works pretty damn good in Linux.
M.R.
I don't like you very much. Please post a lot less.
Cheez
*and then*
No, I know you were joking. My point still stands.
Which fact??? :-/Originally posted by kwigibo
shaik786, wasn't aware of that fact. I know that they are "ANSI Escape Sequences", and I tried them in windows nt4, and didn't work so I assumed they only worked onl *nix systems (which supports vt100).
You've only posted one previous message on this thread... can't be too hard to guess which one kwigibo is talking about!Originally posted by shaik786
Which fact??? :-/
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]