![]() |
|
#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
Accepted for Ph.D. program 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 14:12 |
| [Tutorial] Function Pointers | aaroncohn | C++ Forum | 4 | 17-Feb-2006 12:33 |
| question about inline function | bchasco | C++ Forum | 1 | 22-Jul-2005 16:52 |
| non-member function question | crq | C++ Forum | 1 | 03-Feb-2005 22:59 |
| Revising Script style ?????? | pepee | MySQL / PHP Forum | 4 | 14-Apr-2004 05:59 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The