How to get full control over the console?

泄露秘密 提交于 2020-01-25 11:19:47

问题


I am currently writing a C++ program which must be able to show a rotating cube in a terminal. (school assignment). So I start off with a 60*60 array (two-dimensional vector, to be exact) of chars, which I am going to write to the screen. But if I just do this with two for-loops and std::cout I get very ugly output: just the screen under the previous one, endlessly.

So I need something better, I need to do something like what Vim does: it seems to take over the console, and when you are done it dissapears, and you terminal is back. How can I do this?


回答1:


You can use a library like ncurses to do this.



来源:https://stackoverflow.com/questions/15459466/how-to-get-full-control-over-the-console

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!