I wrote code to print the same text in 2 locations and it works until I insert the cursor movement line and while the code still runs, the result is garbled, the move command gets printed.
#include <stdio.h>
int main(void) {
char str[] = "text"; // Declare string
printf("%s", str); // Print string
printf("\033[4B"); // Move down 4 lines;
printf("%s", str); // Print string
char ch = _getch();
}
VS Debug window prints it corrently:
text
text
CMD prints
text←[4Btext
I tried installing .NET Framework and using a different compiler (gcc to be specific) and even tried running this on 4 different machines, they all produced the same result.