J
Joakim Hove
Hello,
I have a function like this:
/* It actually does something else .... */
void func (int size, const char ** string_list) {
int i;
for (i=0; i < size; i++)
printf("String number %d: %s \n",i,string_list);
}
And would like to (be able) to call it with a literal list of strings,
something like:
func(3 , {"String1" , "Hello", "The last string ..."});
Is that possible? I have tried various casts like (const char **),
(const char [3][]) and (const char [3]*) but to no avail. I am using
gcc with std=gnu99, i.e. I am more than happy to accept C99 features.
Thank you - Joakim Hove
I have a function like this:
/* It actually does something else .... */
void func (int size, const char ** string_list) {
int i;
for (i=0; i < size; i++)
printf("String number %d: %s \n",i,string_list);
}
And would like to (be able) to call it with a literal list of strings,
something like:
func(3 , {"String1" , "Hello", "The last string ..."});
Is that possible? I have tried various casts like (const char **),
(const char [3][]) and (const char [3]*) but to no avail. I am using
gcc with std=gnu99, i.e. I am more than happy to accept C99 features.
Thank you - Joakim Hove