+ 1
How to put the cursor to the previous line after using puts() in C++
2 Answers
+ 3
Is puts() C++? No. Why do you use it? I assume you use Turbo C++...
In Turbo C++ (Though you shouldn't use it as it is deprecated), we have a gotoxy() function under <graphics.h>.
You use it in the following way :
gotoxy(2,2); cout<<"Hello";
To set the Cursor Position in Code::Blocks, you may use SetConsoleCursorPosition in the following way , and include <windows.h> in your program...
void GOTO(int x, int y)
{
HANDLE out = GetStdHandle (STD_OUTPUT_HANDLE);
COORD pos = {x,y};
SetConsoleCursorPosition(out,pos);
}
Then use it in the following way :
GOTO(2,2); cout<<"Hello";
+ 2
Maybe you can find some answers here
http://www.cplusplus.com/forum/general/41709/