Assuming this is a console application, you can print new lines about 24 times, which puts you at the bottom.
The line to be printed is stored in an array / vector of a fixed size of 81 characters (\ 0, terminated at position 81), which is updated using some feeding procedure. This could potentially come from a socket, input, file, call process, etc.
At feed time (timer callbacks, when the file changes, the socket buffer is not empty, whatever), you need to rotate the char text one by one. Assuming the rotation is from right to left, copy all the characters from 1 (not 0) to 80 in i-1, the previous positions. Write a new char at position 80.
The key graphical trick here is to abort your printf with \ r instead of \ n. \ r is a modifier for the returned carriage: the cursor returns to column 0 and does not go to the next line. This allows you to retype the same line.
source share