Last active
October 2, 2023 22:40
-
-
Save ChristopherBilg/74a2f8b87dc2e041c60e455f9e132f0d to your computer and use it in GitHub Desktop.
C Language: Carriage Return Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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