struct students
{
char name[256];
int Roll_number;
};
struct colleges
{
char name[256];
Student students[100];
};
如何访问学生[0] .name,我尝试使用 - >和。运营商是无法访问的
答案 0 :(得分:0)
#include <stdio.h>
struct students {
char name[256];
int Roll_number;
};
struct colleges {
char name[256];
struct students students[100];
};
int main(void)
{
struct colleges c = { };
printf("%s\n", c.students[0].name);
return 0;
}
答案 1 :(得分:0)