I am trying to build a list of strings that I need to pass to a function expecting char **
How do I build this array? I want to pass in two options, each wi
I think what you originally meant to do was to make an array only of characters, not of pointers:
char options[2][100];
options[0][0]='t';
options[0][1]='e';
options[0][2]='s';
options[0][3]='t';
options[0][4]='1';
options[0][5]='\0'; /* NUL termination of C string */
/* A standard C library function which copies strings. */
strcpy(options[1], "test2");
The code above shows two distinct methods of setting the character values in memory you have set aside to contain characters.