delorie.com/archives/browse.cgi | search |
From: | PAULO_MAXIMILIANO_VASQUEZ_BRICHETTI DOT REPSOL AT email DOT ypf DOT com DOT ar |
X-Lotus-FromDomain: | YPF_SA |
To: | djgpp AT delorie DOT com |
Message-ID: | <0325699D.00641DA2.00@email.ypf.com.ar> |
Date: | Mon, 20 Nov 2000 15:14:36 -0300 |
Subject: | function fork() |
Mime-Version: | 1.0 |
Reply-To: | djgpp AT delorie DOT com |
I've some problem with function fork. In the code below the fork call always give -1. Could someone tell me if i'm doing something wrong? Thankx for your help #include <stdlib.h> #include <stdio.h> int sum; main() { int i; sum = 0; printf("The fork value is: %d\n",fork()); for (i = 1; i <= 10; i++) { printf("El valor de i es %d\n", i); fflush(stdout); sum += i; } printf("The total is %d\n", sum); exit(0); } Maximiliano Vasquez
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |