Output of this program?
#include <iostream>
using namespace std;
class myclass
{
public:
int i;
myclass *operator->()
{return this;}
};
int main()
{
myclass ob;
ob->i = 10;
cout << ob.i << " " << ob->i;
return 0;
}
a) 10 10
b) 11 11
c) error
d) runtime error
Submitted by: Administratora) 10 10
Submitted by:
Submitted by:
Read Online C++ Operator Overloading Job Interview Questions And Answers
Top C++ Operator Overloading Questions
☺ | Pick the other name of operator function. |
☺ | What is overloading template? |
☺ | Can you please explain the difference between overloaded functions and overridden functions? |
☺ | Explain overloading unary operator? |
☺ | Can you please explain function overloading? |
Top C Plus Plus Language Categories
☺ | C++ Pointers & Functions Interview Questions. |
☺ | C++ Operator Overloading Interview Questions. |
☺ | C++ Exception Handling Interview Questions. |
☺ | C++ Virtual Functions Interview Questions. |
☺ | C++ Template Interview Questions. |