hello,
what i am trying to do, is have the user type at the bottom of the console, and print the text at the top example:
now this does exactly what i want it to do, untill you have inputted so many times that, it begins to display the text below where your acctually typing.Code:#include <iostream> #include <string> #include <windows.h> using namespace std; void gotoxy ( int x, int y ) { COORD dwCursorPosition = { x, y }; SetConsoleCursorPosition ( GetStdHandle ( STD_OUTPUT_HANDLE ), dwCursorPosition ); } int main() { int loc=0; string test; while(true){ gotoxy(0,23); cout << "type: "; getline(cin, test); gotoxy(0,23); for(int x = test.length()+6; x>0; x--) { cout << ' '; } gotoxy(0,loc); cout << test; loc++; } return 0; }
so basically when int loc reaches 22 i want to move all the text up one line..?
if you compile the code, my question may be easier to understand.
windows,
MSVC++6



LinkBack URL
About LinkBacks


