I'm trying to reposition the text-cursor to top left corner of the console each frame, so the resulted square rendered at the same position
#include <stdio.h>
#include <stdlib.h>
int main() {
while(1) {
printf("\u2554\u2550\u2550\u2550\u2557\n\u255A\u2550\u2550\u2550\u255D\n");
}
}
I found that this is possible in windows by including <windows.h>:
HANDLE hOut;
COORD Position;
hOut = GetStdHandle(STD_OUTPUT_HANDLE);
Position.X = 0;
Position.Y = 0;
SetConsoleCursorPosition(hOut,Position);
How can I do that in Ubuntu?