pointer motion. why are numbers so high? why does it print info in blocks not a constant stream?

馋奶兔 提交于 2019-12-02 06:11:45

Besides printing a newline at the end, you could also do a '\r' at the end it it will move the cursor to the beginning of the existing line, so it will just print over itself each time. To make this work better, change the digit formatting to be a fixed size, like:

printf("%4d, %4d  \r", event.xmotion.x, event.xmotion.y);
fflush(stdout) ;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!