#include <iostream>
#include <windows.h> //for Slepp
int main()
{
std::cout << "It is busy doing something ";
char ch = 0;
unsigned int times;
while (true)
{
switch(++times % 4)
{
case 0:
ch = '-';
break;
case 1:
ch = '\\';
break;
case 2:
ch = '|';
break;
case 3:
ch = '/';
break;
}
//\b让光标回退一个字符,\r让光标回到行首
std::cout << "\b" << ch;
Sleep(40);
}
}
回退转移字符小用法\b
最新推荐文章于 2023-05-19 15:33:56 发布