User Tools

Site Tools


cpp:friend_methods

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:friend_methods [2019/04/19 10:04] – [Φιλικές Συναρτήσεις] gthanoscpp:friend_methods [2019/04/19 10:07] – [Φιλικές Συναρτήσεις] gthanos
Line 16: Line 16:
     int getWidth();     int getWidth();
     int getHeight();     int getHeight();
-    friend void modifyDimensions(Rectangle r, int dw, int dh);+    friend void modifyDimensions(Rectangler, int dw, int dh);
 }; };
  
Line 28: Line 28:
 int Rectangle::getHeight() { return height; } int Rectangle::getHeight() { return height; }
  
-void modifyDimensions(Rectangle r, int dw, int dh) {+void modifyDimensions(Rectangler, int dw, int dh) {
   r.width += dw;   r.width += dw;
   r.height += dh;   r.height += dh;
Line 35: Line 35:
  
 <code cpp RectangleUsage.hpp> <code cpp RectangleUsage.hpp>
-#include "Rectangle.cpp"+#include "Rectangle.hpp"
  
 int main () { int main () {
cpp/friend_methods.txt · Last modified: 2021/05/18 06:21 (external edit)