C++学习-第2章 类与对象.pptVIP

  • 2
  • 0
  • 约7.59千字
  • 约 56页
  • 2018-06-27 发布于福建
  • 举报
C学习-第2章类与对象

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2、通过指向对象的指针访问对象中的成员 对象指针-数据成员名 or 对象指针-成员函数名(参数表) 例如:Time t,*p=t; cout p-hour; //hour是t中的成员 3、通过对象的引用变量访问对象中的成员。 2.4 对象成员的引用(访问) * 1.3.8 内置函数(inline function) #include iostream using namespace std; int max(int a,int b,int c)   { if(ba) a=b; if(ca)a=c; return a; } void main() { int i=10,j=7,k=-2,m; m=max(i,j,k); cout“max=” mendl; } main max * #include iostream using namespace std; inline int max(int a,int b,int c)   { if (ba) a=b; if (ca)a=c; return a;

文档评论(0)

1亿VIP精品文档

相关文档