"In what logical segments of the processes do the variables f and c exist?"
int c = 5;
void main(int argc, char **argv)
{
int f = fork();
if(f == 0)
{
c += 5;
}
else
{
f = fork();
c += 10;
if(f)
{
c += 5;
}
}
}
Hi guys I'm kind of stuck on this question, I guess that c is a global variable and is in the data region and that f is in the stack (as main is a procedural call), but I am not clear on what is meant by logical segments. I would greatly appreciate an expert eye to look over this question and tell me what I am missing. Thanks in advance.