C++语言开发示例:08. 混合类型
mixtypes.cpp
#include <iostream>
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;
std::cout << trio->year << std::endl;
const antarctica_years_end *arp[3] = {&s01, &s02, &s03};
std::cout << arp[1]->year << std::endl;
const antarctica_years_end **ppa = arp;
auto ppb = arp;
std::cout << (*ppa)->year << std::endl;
std::cout << (*(ppb + 1))->year << std::endl;
} 最后更新于1年前
本文由人工编写,AI优化,转载请注明原文地址: C++语言开发示例:08. 混合类型
推荐阅读
评论 (0)
发表评论
昵称:加载中...
暂无评论,快来发表第一条评论吧!