C 替换打印文本
C Replace Printed Text
所以我有了这个脚本,我想用“Lets”替换打印的“Dont”。我不想使用 system() 因为效果不同。
#include <stdio.h>
int main(){
printf("Dont do this");
/* Replace printed "Dont" with "Lets" */
return 0;
}
尝试 \r
:
#include <stdio.h>
int main(){
printf("Dont do this");
printf("\rLets");
printf("\n");
return 0;
}
所以我有了这个脚本,我想用“Lets”替换打印的“Dont”。我不想使用 system() 因为效果不同。
#include <stdio.h>
int main(){
printf("Dont do this");
/* Replace printed "Dont" with "Lets" */
return 0;
}
尝试 \r
:
#include <stdio.h>
int main(){
printf("Dont do this");
printf("\rLets");
printf("\n");
return 0;
}