這裏是我的代碼。使用報警(3)退出程序 - C++
#include<iostream>
int main()
{
std::string str;
while(true)
{
std::cout<<"enter string \n";
alarm(3);
getline(std::cin,str);
// calling another function in some other class,
and return to here (If not entered any string in 3 sec)
}
return 0;
}
2秒後它退出我的程序。但是,我想繼續調用另一個函數並返回到同一個getline()。可能嗎?? 感謝
這在您的其他問題中不止一次得到解答。 – chris 2013-03-21 07:03:00
不一樣-chris 觀察一次,現在我想繼續在同一個程序中。 反正只是在這裏放下你的想法 謝謝 – 2013-03-21 08:12:21