共享c语言程序讲义指针.pptxVIP

  • 1
  • 0
  • 约4.29千字
  • 约 51页
  • 2022-04-01 发布于北京
  • 举报
1;2;3;4;5;6;pa;;9;10;11;12;例:设一个a数组,整型,有10个元素。用三种方法输出各元素:;例:设一个a数组,整型,有10个元素。用三种方法输出各元素:;例:设一个a数组,整型,有10个元素。用三种方法输出各元素:;16;17;18;19;20; pt_int = pig; *pt_int += dog; //pig=pig+dog=34 cout Pig now has the value of *pt_int \n; general = pt_int; //指向int型的指针赋值给void型指针 pt_float = x; y += 5 * (*pt_float); cout y now has the value of y \n; general = pt_float; //指向float型的指针赋值给void型指针; const char *name1 = John; //指向常量的指针,所指对象之值不能改变 char *const name2 = John; //常量指针,指针本身不能被改变 return 0; } 运行结果: Pig now has the value of 34 y now has the value of 38.3125;23;void p

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档