In C struct array elements must have a fixed size, so the char *theNames[] is not valid. Also you can not initialize a struct that way. In C arrays are static, i.e. one cannot change their size dynamically.
A correct declaration of the struct would look like the following
struct potNumber{
int array[20];
char theName[10][20];
};
and you initialize it like this:
struct potNumber aPot[3]=
{
/* 0 */
{
{10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 /* up to 20 integer values*/ },
{"Half-and-Half", "Almond", "Raspberry", "Vanilla", /* up to 10 strings of max. 20 characters */ }
},
/* 1 */
{
{10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 /* up to 20 integer values*/ },
{"Half-and-Half", "Almond", "Raspberry", "Vanilla", /* up to 10 strings of max. 20 characters */ }
},
/* 2 */
{
{10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 /* up to 20 integer values*/ },
{"Half-and-Half", "Almond", "Raspberry", "Vanilla", /* up to 10 strings of max. 20 characters */ }
}
};
But, I'm pretty sure this is not what you want. The sane way to do this required some boilerplate code:
struct IntArray
{
size_t elements;
int *data;
};
struct String
{
size_t length;
char *data;
};
struct StringArray
{
size_t elements;
struct String *data;
};
/* functions for convenient allocation, element access and copying of Arrays and Strings */
struct potNumber
{
struct IntArray array;
struct StringArray theNames;
};
Personally I strongly advise against using naked C arrays. Doing everything through helper structs and functions keeps you clear from buffer under/overruns and other trouble. Every serious C coder builds a substancial code library with stuff like this over time.
structis defined?