+ 4
Can a macro use a function as parameter?
How can we make a pointer to a function in a macro? I am unable to design such a macro. Please Help!
2 Answers
+ 4
#define Foreach_string(iterator, ...) \
for (char **iterator = (char*[ ] ) { __VA_ARGS__, NULL}; *iterator; iterator++)
inside main() you use it as...
Foreach_string(i, "someString", str, "someOtherString"){ ///... other statements }
+ 6
Thank You!!