+ 2
How do i create a struct variable for nested struct in c?
struct stu{ char name; int clas; struct date { int dates; }; }; How can i create a struct variables for date inside main ? Like stu date num; It show error
3 Antworten
+ 7
struct stu {
char name;
int clas;
struct date
{
int dates;
};
};
int main() {
struct stu s, *ps = &s;
s.dates = 74;
printf("%d\n", ps->dates); // 74
return 0;
}
0
write one of the structure variable in another structure