Answers for "fork example questions counter"

0

fork example questions counter

int counter = 0;
int main()
{
  int i;
  for (i = 0; i < 2; i ++){
    fork();
    counter++;
    printf("counter = %d\n", counter);
  }
  printf("counter = %d\n", counter);
  return 0;
}
Posted by: Guest on February-04-2021

Browse Popular Code Answers by Language