Original Post
🔒 Locked
Console
Advertisement
1. print enough '\n' to scroll the text off the screen
2. system ( "cls" ); //(windows)
system ( "clear" ); //(linux)
3. (windows only)
4. I assume there is something like the above code specific to linux, but I don't know for sure
--To each his own on the choice. Though I'm sure many have an opinion on which way is best
2. system ( "cls" ); //(windows)
system ( "clear" ); //(linux)
3. (windows only)
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); }4. I assume there is something like the above code specific to linux, but I don't know for sure
--To each his own on the choice. Though I'm sure many have an opinion on which way is best
Quote:
Original post by KulSeran
4. I assume there is something like the above code specific to linux, but I don't know for sure
Yea there is, it is called ncurses :) check it out if you want it is quite easy and fun :D
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement