b***y 发帖数: 2799 | 1 ☆─────────────────────────────────────☆
ruisher (aa) 于 (Fri Sep 2 21:58:32 2005) 提到:
Suppose I have a class which has an array as a private member, if I want to
get the address of the array,
class A{
public: ...
.....
//if I want to get the address of the array
float & get_xyz { return xyz[0];}
or
float * get_xyz { return xyz;}
what's the difference between this two?For the first one, why can't I use
const sth like "float & get_xyz const{ return xyz[0];}
.......
private:
float xyz[ |
|