以下代码可以实现window控制台下字符串的闪烁效果
#include <iostream>
#include <windows.h>
#include <conio.h>
using std::cout;
int main()
{
while (true)
{
char begintitle[] = "press any key to start...";
cout << begintitle;
Sleep(50);
for (int i = 0; i < strlen(begintitle); i++)
cout << "\b \b";
Sleep(50);
if (_kbhit())
break;
}
}
可以作为游戏画面首页面的显示效果
