Hello, I use the function Clrscr(), you know, the one from the FAQ.
However, when I do this:
it doesn't do the clear screen! Instead, it displays this:Code:cout<<"test"; clrscr(); cout<<"only this text should appear";
testonly this text should appear
But, when I do this:
so with the endl, it works correct! Now it only displays:Code:cout<<"test"<<endl; clrscr(); cout<<"only this text should appear";
only this text should appear
How is this possible? Why do I have to do endl before the function will work?
btw this is the function:
Code:void clrscr() { COORD coordScreen = { 0, 0 }; DWORD cCharsWritten; CONSOLE_SCREEN_BUFFER_INFO csbi; DWORD dwConSize; HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); GetConsoleScreenBufferInfo(hConsole, &csbi); dwConSize = csbi.dwSize.X * csbi.dwSize.Y; FillConsoleOutputCharacter(hConsole, TEXT(' '), dwConSize, coordScreen, &cCharsWritten); GetConsoleScreenBufferInfo(hConsole, &csbi); FillConsoleOutputAttribute(hConsole, csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten); SetConsoleCursorPosition(hConsole, coordScreen); }



LinkBack URL
About LinkBacks


