我正在寫在C程序的控制,在這個模型:空調系統()採用標準輸出
//Block 1: Does a lot of operations, including debug messages
strcpy(call, "xdg-open ");
strcat(call, url);
system(call);
//Block 2: Does a lot of operations, including debug messages
的system()
調用後,它看起來像這一函數的標準輸出的控制及塊2調試消息不會打印更長時間,只會顯示Block 1消息。
是否有人知道發生了什麼,以及可能的解決方案是什麼?
'system'調用等待其子進程結束。換言之,只有在'xdg-open'將被關閉時,控件纔會被傳遞給block2。 –
我現在明白,但我該如何解決這個「問題」? – amportugal