int small_func(int a)
{
// input plus two
return (a + 2);
}
#define SMALL_FUNC(a) ({ \
int result;
do { \
/* input plus two */ \
result = a + 2; \
} while(0); \
result; \
})
How to Add Comments to Macros
Showing posts with label C. Show all posts
Showing posts with label C. Show all posts
Thursday, April 18, 2019
for loop multiple conditions
what is the right?
1. for (i = 0, j = 0; i < loop, j < loop2; i++, j++)
2. for (i = 0, j = 0; (i < loop) && (j < loop2); i++, j++)
The answers are
Are multiple conditions allowed in a for loop?
GeeksforGeeks: Output of C Program | Set 22, question 2
for example
i = 1, 2; is same as i = 2;
1. for (i = 0, j = 0; i < loop, j < loop2; i++, j++)
2. for (i = 0, j = 0; (i < loop) && (j < loop2); i++, j++)
The answers are
Are multiple conditions allowed in a for loop?
GeeksforGeeks: Output of C Program | Set 22, question 2
for example
i = 1, 2; is same as i = 2;
Subscribe to:
Posts (Atom)