Linux 如何改变输出的内容

auto nLineCount = _vtInfo.size();
for (auto str : _vtInfo)
{
    cout << str.c_str() << endl;
}
cout << "Connect Count:" << _mdAF101.GetConnectCount() << endl;
cout << instrument << " " << ++_nReceviedCount << endl;
printf("\033[%dA", nLineCount + 2);

printf(“\033[%dA”, nLineCount);
表示将光标上移nLineCount,这样每次都是改变了之前输出的内容

参考:
http://zisedeqing.blog.163.com/blog/static/9555087120129111485394/
http://blog.csdn.net/kevinshq/article/details/8179252

posted on 2022-07-19 23:47  norsd  阅读(13)  评论(0)    收藏  举报  来源

导航