本例来自c++ primer plus 第六版 的 119页
#include
#include
#include
#include
#include
using namespace std;
const int MAXN=1e3;
typedef long long LL;
char str[MAXN];
struct antarctica_years_end
{
int year;
};
int main()
{
antarctica_years_end s01, s02, s03;
s01.year=1998;
antarctica_years_end *pa=&s02;
pa->year=1999;
antarctica_years_end trio[3];
trio[0].year=2003;
cout<<(trio)->year<year访问下一个元素
const antarctica_years_end *arp[3]={&s01, &s02, &s03};//数组指向了三个地址
cout<year<year<year<