麻烦哪位用C++帮我写一下此程序,谢啦!

来源:百度知道 编辑:UC知道 时间:2024/06/03 09:47:11
Show an example of a structure declared within another structure (a nested structure). Declare data members in both structs, and declare and define member functions in both structs. Write a main( ) that tests your
好像超出了范围

嵌套结构体
#include <iostream.h>
#define MAX 10

typedef struct course
{
char cname[20];
int chour;
int cteam;
};

typedef struct list
{
course list[MAX];
int size;
}list;

list list={{
{"str1",90,1},
{"str2",72,2},
{"str3",72,1},
}};
list.size = 5;

void main()
{
//省略
}