Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嘿如何覆盖c中的字符?就像在 printf 语句中一样。现在我想回去用空格覆盖@并增加屏幕上的@。我正在尝试实现蛇游戏。
#include<stdio.h> #include<conio.h> main() { printf("@"); }
您正在寻找的是ANSI 控制字符。发送这些将允许您移动光标。
例如:
printf("%c[%dA", 0x1B, 10); // move cursor 10 lines up