Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

0
[C][DEFINES] i need to understand why its happeing?
Post Flair (click to view more posts with a particular flair)
Author Summary
Usual-Vermicelli-867 is in DEFINES
Post Body

i now study for my test and i have this q

#define MAX2(A,B) (((A)>(B))?(A):(B)) the q start here

#define MAX3(A,B,C) (MAX2(MAX2(A,B),C))

int f();

int g();

int h(); and ends here the (rest of the code i did
the q prety much ask how many times does any function runs)
the answer is f:4 g:2 and h:1

why g is 2?

i get f4 i get h1 why g 2?

and here is the order its happeing:

f ,g, f, h,f g,f

why g happens in the end again?

int main()

{

int i = MAX3(f(), g(), h());

}

int f() {

int static Foccur = 0;

Foccur ;

printf("f runed %d\n", Foccur);

return 5;

}

int g() {

int static goccur = 0;

goccur ;

printf("g runed %d\n", goccur);

return 4;

}

int h() {

int static hoccur = 0;

hoccur ;

printf("h runed %d\n", hoccur);

return 1;

}

Author
Account Strength
100%
Account Age
3 years
Verified Email
Yes
Verified Flair
No
Total Karma
62,536
Link Karma
2,380
Comment Karma
60,156
Profile updated: 2 days ago

Subreddit

Post Details

Location
We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
4 months ago