Vidyalelo
C++ Programming · Q107

Classes and Objects in C++

Programming · C++ Programming · question 107

Q107

What will be the output of the following C++ code? #include using namespace std; class myclass public: int i; myclass *operator->() return this; ; int main() myclass ob; ob->i = 10; cout i; return 0;

A.
10 10
Answer
B.
11 11
C.
error
D.
runtime error

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board