const char *things[] = { "One", "Two", "Three", NULL }; // NULL terminated for (const char **p = things; *p; p++) { printf("thing=%s\n", *p); // Use star-p }This only works when you can define your own NULL-terminated array.
Programming Tips - C/C++: efficiently loop thru a constant array of strings
Date: 2014apr8
Language: C/C++
Platform: agnostic
Q. C/C++: efficiently loop thru a constant array of strings
A. Here is a nice way do do that: