cpp:copy_constructors
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
cpp:copy_constructors [2018/05/07 07:07] – [Κατασκευαστές Αντιγραφείς] gthanos | cpp:copy_constructors [2018/05/07 07:09] – [Ορισμός ενός κατασκευαστή αντιγραφέα] gthanos | ||
---|---|---|---|
Line 27: | Line 27: | ||
<code cpp> | <code cpp> | ||
- | Rectangle:: | + | Rectangle:: |
width = r.width; height = r.height; | width = r.width; height = r.height; | ||
} | } | ||
</ | </ | ||
- | Συνολικά η κλάση // | + | Η μεταβλητή //r// δηλώνεται ως //const// διότι κατά την εκτέλεση του κατασκευαστή το αντικείμενο //r// δεν θα μεταβληθεί. |
<code cpp Rectangle.cpp> | <code cpp Rectangle.cpp> |
cpp/copy_constructors.txt · Last modified: 2022/05/12 19:41 by gthanos