Skip to content

Instantly share code, notes, and snippets.

@ChristopherBilg
Last active October 2, 2023 22:40
Show Gist options
  • Save ChristopherBilg/74a2f8b87dc2e041c60e455f9e132f0d to your computer and use it in GitHub Desktop.
Save ChristopherBilg/74a2f8b87dc2e041c60e455f9e132f0d to your computer and use it in GitHub Desktop.
C Language: Carriage Return Example
#include <stdio.h>
#include <unistd.h>
#define itterator 100000
#define pollingDelay 1
int main() {
for(int i = 1; i <= itterator; i++){
printf("i = %d\r", i);
sleep(pollingDelay/10);
fflush(stdout);
}
printf("\n");
}
output: carriage_return.c
gcc carriage_return.c -o output -lm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment