How to pass arguments in __VA_ARGS to a 2d character array? [closed]
If you are under C99, you can use compound literals #include <stdio.h> #define MACRO(…) func( \ sizeof((char *[]){__VA_ARGS__}) / sizeof(char *), \ (char *[]){__VA_ARGS__} \ ) void func(size_t n, char **p) { size_t i; for (i = 0; i < n; i++) { printf(“%s\n”, p[i]); } } int main(void) { MACRO(“abc”, “def”, “ghi”); return 0; … Read more