cpp:copy_constructors
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:copy_constructors [2020/04/14 15:35] – [Άλλη περίπτωση κλήση Copy Constructor] gthanos | cpp:copy_constructors [2020/04/14 16:00] – [Μια πιο σύνθετη περίπτωση] gthanos | ||
---|---|---|---|
Line 222: | Line 222: | ||
Rectangle(); | Rectangle(); | ||
~Rectangle(); | ~Rectangle(); | ||
- | Rectangle(Rectangle &r); | ||
void setWidth(int w); | void setWidth(int w); | ||
void setHeight(int h); | void setHeight(int h); | ||
Line 271: | Line 270: | ||
int main() { | int main() { | ||
- | Point p{10,5}; | + | Point p{5,5}; |
Rectangle r1{5, | Rectangle r1{5, | ||
Rectangle r2 = r1; | Rectangle r2 = r1; | ||
+ | Rectangle r3(r1); | ||
| | ||
moveOrigin(r1, | moveOrigin(r1, |
cpp/copy_constructors.txt · Last modified: 2022/05/12 19:41 by gthanos