0
如何在循环内运行一个函数并仍然保持循环运行而不必等待函数2完成时?运行函数并保持循环运行C++
int main(){
function1();
}
function1(){
while(1){
function2(); }
}
function2(){
//some task that needs to do independently while, While loop runs
}
你需要多个线程。 http://en.cppreference.com/w/cpp/thread/thread – 0x5453
http://man7.org/linux/man-pages/man3/popen.3.html – Roelant
所以你想运行'function1()'和'function2()'在同一时间? – Javia1492