Hello,
gcc
I am just getting back into c programming and I am just practicing with structures. However, I have a nested structure that I want to fill from another initialized structure. However, I don't think my technique is correct way to do this.
Any advice would be most helpfull,
#include <stdio.h>
typedef struct
{
char name[20];
int age;
} NAME_AGE_STRUCT;
typedef struct
{
int ID;
NAME_AGE_STRUCT info[];
} DETAILS_STRUCT;
int main(void)
{
DETAILS_STRUCT details;
NAME_AGE_STRUCT extra_details [] = {
{ "john", 34 },
{ "peter", 44 },
};
printf("=== Start program\n");
details.ID = 2;
details.info = extra_details;
return 0;
}