Dear all:
I have a structure that goes that this:
Code:
typedef struct someStruct {
char name[30];
int number;
} someStruct_t;
Then in main(), I declare an array of structures:
Code:
someStruct_t structures[3];
and I declare an array of names:
Code:
char names[3][30] = { "Mary", "John", "Lily" };
When I tried to assign the structure member "name" to the first string of "names" like the following:
Code:
structures[0].name = names[0];
It tells me that "incompatible types when assigning to type ‘char[30]’ from type ‘char *’"
But I thought they are both addresses, the value of structures[0].name should be able to be assigned the value of names[0], what did I do wrong?
Any help is appreciated, thanks
barramundi9