type cast pointer to struct in c code example
Example: return pointer to struct in C
typedef struct {
char name[20];
int age;
} Info;
Info* GetData() {
Info *info;
info = (Info *) malloc( sizeof(Info) );
scanf("%s", info.name);
scanf("%d", &info.age);
return info;
}