类中数据成员的访问,不管是方法或属性,有两种访问方法用操作符”.”或”->”。
“.”操作符,用在是定义是普通对象(参考对象定义),以Cpeople类来说明:
1 2 |
Cpeople kim; unsigned int a = kim.age; |
“->”操作符,用在是定义是指针对象(参考对象定义)
1 2 |
Cpeople* kima = new Cpeople(); unsigned int b = kima->age; |
如果类中有静态成员static,静态成员访问除了以上两咱方法,还有另一种语法。
1 |
unsigned int Num = Cpeople::Num; |
类中数据成员的访问访具体定义如下:
如果还有当访问时编译器会有可能发生二义性时,再前面加上类名和”::”操作符。
Thanks. I enjoy this. fluconazole tablets
Nicely put. Cheers. kratom capsules
You definitely made the point. cbd oil texas
With thanks. Loads of facts.
canadian drugs
Nicely put. Thank you! kratom for sale
Appreciate it! Lots of postings.
generic viagra 100mg
Thanks. Quite a lot of postings!
modafinil dosage
Nicely spoken truly. ! cbd oil for pain
Wonderful write ups. Many thanks. https://viagrapycharm.com/
This is nicely expressed! ! gabapentine
Nicely put. Cheers! armodafinil vs modafinil
Helpful information. With thanks. https://viagrapython.com/
Nicely put. Thanks. viagra without doctor prescription
Awesome stuff. With thanks! canadian drugs
Thanks a lot, I like this. Granbury Lasix 20 Mg
Well voiced truly. ! viagra 100mg
Whoa tons of great data. hemp cbd oil
Superb write ups. Thank you! hydrochlorothiazide 25 mg
Wow loads of terrific data. Que Pasa Si Tomo Cialis Sin Necesitarlo
With thanks. I like it. acyclovir 800 mg