Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
n階乗を計算するforkメソッドを使用してCでプログラムを書きたいです。このプログラム (プロセス) は、子を 1 つだけ作成します。各プロセス (親と子) は、完全なシーケンスの約半分を計算します。次に、親は結果を結合し、最終結果を出力します。
2 つのプロセス間でデータを渡すにはどうすればよいですか?
fork を使用せずに、pthreads を使用してください。結果を組み合わせる方が簡単です (フォークしたために IPC に対処する必要はありません)。