example of c printf with line rewriting

This commit is contained in:
RouxAntoine 2022-12-27 17:03:44 +01:00
parent afeba29043
commit 892e213879
Signed by: antoine
GPG Key ID: 098FB66FC0475E70
3 changed files with 21 additions and 0 deletions

2
.editorconfig Normal file
View File

@ -0,0 +1,2 @@
[Makefile]
indent_style = tab

8
Makefile Normal file
View 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

View 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");
}