![]() |
|
#1
|
|||
|
|||
A simple question of a C++ functionHere is a class
CPP / C++ / C Code:
It works, but my question is that 'image' is private of 'rhs', how can you visit a private variable of rhs outside (rhs.image)? |
|
#2
|
|||
|
|||
Re: A simple question of a C++ functionQuote:
The function foo that is being defined here is a member function of the class (since it is inside the class Complex {}; braces), so it has access to all class members. If "outside" functions want to print the value of the image member, they can use the foo function. If "outside" functions want to get the value of the image member, thay can use the GetImage function. Regards, Dave |
Recent GIDBlog
First week of IA training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Include] Doubly-linked List | dsmith | C Programming Language | 6 | 14-Apr-2006 13:12 |
| [Tutorial] Function Pointers | aaroncohn | CPP / C++ Forum | 4 | 17-Feb-2006 11:33 |
| question about inline function | bchasco | CPP / C++ Forum | 1 | 22-Jul-2005 15:52 |
| non-member function question | crq | CPP / C++ Forum | 1 | 03-Feb-2005 21:59 |
| Revising Script style ?????? | pepee | MySQL / PHP Forum | 4 | 14-Apr-2004 04:59 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The