You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 10_this_pointer/00_questions.txt
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,10 @@
8
8
One of the functions should be setData() to set the properties of the object. Make
9
9
sure the names of formal arguments are the same as names of instance variables.
10
10
11
-
02. Use this pointer to get the address of calling object. define a class A and a member function that returns the address of calling object.
11
+
02. Use this pointer to get the address of caller object. define a class A and a member function that returns the address of caller object.
12
12
13
13
03. Define a class Complex with appropriate instance variables and member functions. Overload binary (+) to add two complex numbers and use this pointer to access members
14
14
15
-
04. Create a class Rectangle and include a member function area and a function setDimensions to set width and height of the rectangle. Enable method chaining by returning the this pointer from the setDimensions function.
15
+
04. Create a class Rectangle and include a member function area and a function setDimensions to set width and height of the rectangle. Enable method chaining by returning the this pointer from the setDimensions function.
16
+
17
+
05. Use this pointer to get the reference of caller object. define a class A and a member function that returns the reference of caller object.
0 commit comments