User Tools

Site Tools


cpp:copy_constructors

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
cpp:copy_constructors [2021/05/07 08:32] – [Μια πιο σύνθετη περίπτωση] gthanoscpp:copy_constructors [2021/05/07 08:35] – [Μια πιο σύνθετη περίπτωση] gthanos
Line 229: Line 229:
     int getHeight();     int getHeight();
     void setOrigin(Point *p);     void setOrigin(Point *p);
-    Point *getOrigin();+    Point *getOrigin() const;
 }; };
  
Line 259: Line 259:
 int Rectangle::getHeight() { return height; } int Rectangle::getHeight() { return height; }
 void Rectangle::setOrigin(Point *p) { origin = p; } void Rectangle::setOrigin(Point *p) { origin = p; }
-Point *Rectangle::getOrigin() { return origin; }+Point *Rectangle::getOrigin() const { return origin; }
 </code> </code>
  
cpp/copy_constructors.txt · Last modified: 2022/05/12 19:41 by gthanos