diff --git a/mm.c b/mm.c index 98d60ae..1147342 100644 --- a/mm.c +++ b/mm.c @@ -83,12 +83,24 @@ int main(int argc, char *argv[]) { qsort(pt, length, sizeof(int), numcmp); // Print out numbers - fprintf(stdout, "%s: Sorted output is: \n", argv[0]); + fprintf(stdout, "%s: Sorted output is: \n", argv[0]); for (i=0; i 0) { + int wc = wait(NULL); //waiting for the child process to end + fprintf(stdout, "this is the parent(pid:%d) and I was waitting for process %d to end,\nand also my child pid is %d",(int) getpid(),(int) wc,(int) rc); + fprintf(stdout, " the mean is %d\n", mean(pt,length)); + fprintf(stdout, "%s: FIN.\n", argv[0]); + } + return 0; }