C - Remove and replace printed items

后端 未结 3 1883
生来不讨喜
生来不讨喜 2021-01-14 02:21

I\'m writing a program in C compiled in gcc. The question relates to homework, but the specific part I need help with is not part of the homework assignment. A similar que

3条回答
  •  滥情空心
    2021-01-14 03:08

    Use the \b (backspace) character.

    printf("Quick brown fox");
    int i;
    for(i=0; i < 9; i++)
    {
        printf("\b");
    }
    printf("green fox\n");
    

    I noticed that putting a \n on the first printf() messed up the output.

提交回复
热议问题