example of c printf with line rewriting
This commit is contained in:
parent
afeba29043
commit
892e213879
2
.editorconfig
Normal file
2
.editorconfig
Normal file
@ -0,0 +1,2 @@
|
||||
[Makefile]
|
||||
indent_style = tab
|
8
Makefile
Normal file
8
Makefile
Normal file
@ -0,0 +1,8 @@
|
||||
.PHONY: control-sequence-introducer
|
||||
|
||||
CC_FLAGS=-Wall -O2
|
||||
GCC_BIN=gcc
|
||||
|
||||
control-sequence-introducer:
|
||||
@echo "Building control-sequence-introducer ..."
|
||||
@$(GCC_BIN) $(CC_FLAGS) control-sequence-introducer.c -o control-sequence-introducer.ex
|
11
control-sequence-introducer.c
Normal file
11
control-sequence-introducer.c
Normal file
@ -0,0 +1,11 @@
|
||||
#include<stdio.h>
|
||||
#include<unistd.h>
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
printf("Hello world");
|
||||
fflush(stdout);
|
||||
sleep(2);
|
||||
printf("\33[2K\rHello world everybody");
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user