So, I'm learning gcc and I was doing a few tests, the first thing i noticed is that this code:
int pid = getpid();
printf("\nPid iniziale %d",pid);
pid = fork();
outputs:
Pid iniziale 1572Pid iniziale 1572
instead of:
Pid iniziale 1572
Why is that? Also it doesn't even calculate the \n I need to do that for homework but I can't even get past that, because of that double output, I have some written code after but it changes nothing and i did those tests without comments.