Do you like risk?
#define SIZE_OF_CURRENCIES (((long)&chrCurLast - (long)&chrCur00) / sizeof(char*))
char *chrCur00 = "EUR"; //
char *chrCur01 = "USD";
char *chrCur02 = "AUD";
char *chrCurLast = "";
int _i = 0;
for (; _i<SIZE_OF_CURRENCIES; _i+=1) {
char *_chrCur = *(&chrCur00 + _i);
edited_______________
or with no index at all
char **_chrCur = &chrCur00;
for (; _chrCur<&chrCurLast; _chrCur+=1) {
...
Just noticed global variables are sorted alphabetically.
edited 2 _______________________
Just realized that you might build the array into a struct with no risk at all.
typedef struct {
char *c00;
char *c01;
char *c02;
} CURRENCIES;
CURRENCIES *currencies = {
c00 = "EUR";
c01 = "USD";
c02 = "AUD";
}
char **_chrCur = (char**)currencies;
char **_chrCurLast = _chrCur + sizeof(CURRENCIES) / sizeof(char*);
for (; _chrCur<_chrCurLast; _chrCur+=1) {