0
Hello, I have this code:
#include <iostream>
#include <windows.h>
using namespace std;
bool gotoxy(const WORD x, const WORD y) {
COORD xy;
xy.X = x;
xy.Y = y;
return SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), xy);
}
int main() {
system("MODE CON COLS=20 LINES=30");
gotoxy(0, 29);
for(int i=0; i < 20; ++i) {
cout << "a";
}
return 0;
}
This code works fully, with one problem: caaracters 'a' are not printed on the last line, but on the penultimate one. I think this behavior is due to a line break that is inserted. Does anyone know a way around this behavior? Thank you!
The last line is actually
input
, no? Where the user is going to type something, then I don’t think it makes sense to write something in the input (or if it’s not the user, that’s where the pointer stopped). If I understand your problem.– Guilherme Nascimento