我正在尝试使用单个 puts 而不是嵌套循环来打印 char 矩阵,但我总是在打印结束时再得到一个字符。我要做一个乒乓球游戏,我需要尽快更新屏幕。
void main()
{
int x, y;
char map[40][80];
for(y=0; y<40; y++)
{
for(x=0; x<80; x++)
{
map[y][x]='o'; //Just for testing.
}
}
puts(map);
}
使用此代码打印的最后两行是:
ooooooooooooo...o (80 'o's)
<