I'm having a hard time understanding what happens when I declare an array in a struct. Talking about normal arrays (int, float, char... type) I know that the name of the array is itself a pointer to the first element of the array. However, let's say I have a struct like this:
struct student
{
char name[12];
int age;
}
and in the main function let's say I declare: struct student s1;
Well, I don't understand how this variable is allocated in memory.
Are there 4 bytes for the age, and 10 bytes for the string, but what about the pointer named s1.name (which is a pointer to the first element of the string, right?), does it get allocated as well in the new struct or not?