왜 6번째줄에 저렇게 나오는지랑
그리고 count변수 count++이렇게 해놨는데
왜 6번째줄에서 다시 초기화되고 순서대로 안증가하는지가 궁금하고 해결하고 싶은데..
이하는 내소스
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
int main(){
pid_t pid;
int ProcNo;
int count = 0;
for(ProcNo=1;ProcNo<6;ProcNo++){
pid = fork();
if(pid>0){
printf("<%d - M >%d ",ProcNo,pid,count++);
}
}
return 0;
}
내가 올려준 코드하고 비교해봐 뭐가 잘못되었는지 알 수 있어
pid == 0 일때 동작이 없내.. 여튼 내가 올려준 hwp 를 보던지 링크주소를 보던지 하면 답이 나올꺼임
히히형 고맙습니다. 많은 도움 되었습니다.