cpp:friend_methods
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
cpp:friend_methods [2017/04/20 15:51] – [Φιλικές Κλάσεις] gthanos | cpp:friend_methods [2017/04/20 15:58] – [Φιλικές Κλάσεις] gthanos | ||
---|---|---|---|
Line 84: | Line 84: | ||
class Cuboid { | class Cuboid { | ||
- | Rectangle | + | Rectangle |
int length; | int length; | ||
public: | public: | ||
- | | + | |
- | r.width += dw; | + | int volume(); |
- | r.height | + | } |
- | | + | |
- | | + | Cuboid:: |
+ | rect = r; length | ||
+ | } | ||
+ | |||
+ | int Cuboid:: | ||
+ | return r.width * r.height | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | <code cpp CuboidVolume.cpp> | ||
+ | #include < | ||
+ | |||
+ | int main() { | ||
+ | Rectangle rectangle(5, | ||
+ | | ||
+ | cout << " | ||
} | } | ||
</ | </ |
cpp/friend_methods.txt · Last modified: 2021/05/18 06:21 (external edit)