简体   繁体   English

C 替换打印文本

[英]C Replace Printed Text

So I have this script and I want to replace printed "Dont" with "Lets".所以我有这个脚本,我想用“Lets”替换打印的“Dont”。 I don't want to use system() since the effect is different.我不想使用 system() 因为效果不同。

#include <stdio.h>

int main(){
    printf("Dont do this");
    /* Replace printed "Dont" with "Lets" */
    return 0; 
}

Try \r :尝试\r

#include <stdio.h>

int main(){
    printf("Dont do this");
    printf("\rLets");
    printf("\n");
    return 0; 
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM