私のプログラムはuser.thenから範囲を取り、3つのプロセスを作成して1つずつ実行しますが、すべてのプロセスを同時に実行したいです。
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/wait.h>
void function();
cin>>range;
cin>>process;
int main() {
int range = 1000;
int i;
int pid;
int pid1;
for(i = 0; i < ; i++) {
pid1 = fork();
}
if(pid1==0) {
pid = getpid();
printf("The process id is: %d\n", pid);
function(range);
}
else {
wait(0);
}
return 0;
}