如果在Sleep()命令处于活动状态时输入内容,我找不到阻止此程序退出的解决方案。
cout<<"Start"<<endl;
Sleep(5000); //<--- if I input anything while this is active the program quits after the time ends
cout<<"End"<<endl; //this is outputted after Sleep(),but the program quits immediately after it
我可以在Sleep()命令处于活动状态时以某种方式禁用用户输入,还是应该执行其他操作?请告诉我你的意见。