当前位置: 代码迷 >> 综合 >> 【学习】C++(2)指针的引用
  详细解决方案

【学习】C++(2)指针的引用

热度:67   发布时间:2024-01-21 07:26:34.0

数据对象:简单变量  int *ps = new int;

                           访问指针内容:*ps;

                      数组          int * ps = new int[10];

                           访问数组元素:ps[0],ps[1]....

                      结构          inflatable* ps = new inflatable;                           

                           访问成员:ps->price

                                                或者(*ps).volume

struct  inflatable

 {

   chan name[20];

   float volume;

   double price;

 }                                 

  相关解决方案