User Tools

Site Tools


cpp:object_creation

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:object_creation [2017/04/20 08:13] – [Δημιουργία και ανάθεση αντικειμένων σε δείκτες] gthanoscpp:object_creation [2017/04/20 08:13] – [Δημιουργία και ανάθεση αντικειμένων σε δείκτες] gthanos
Line 82: Line 82:
   r2 = new Rectangle = {5, 6};   r2 = new Rectangle = {5, 6};
   r3 = new Rectangle[2] { {4,8}, {7,3} };   r3 = new Rectangle[2] { {4,8}, {7,3} };
-  cout << "rect's area: " << obj.area() << '\n'+  cout << "rect's area: " << obj.area() << endl
-  cout << "*r1's area: " << foo->area() << '\n'+  cout << "*r1's area: " << foo->area() << endl
-  cout << "*r2's area: " << bar->area() << '\n'+  cout << "*r2's area: " << bar->area() << endl
-  cout << "r3[0]'s area:" << baz[0].area() << '\n'+  cout << "r3[0]'s area:" << baz[0].area() << endl
-  cout << "r3[1]'s area:" << baz[1].area() << '\n';       +  cout << "r3[1]'s area:" << baz[1].area() << endl;       
   delete bar;   delete bar;
   delete[] baz;   delete[] baz;
cpp/object_creation.txt · Last modified: 2021/05/07 06:22 (external edit)