What will be the output if the following C++ program? #include<iostream.h>…
DSSSB 2018
What will be the output if the following C++ program?
#include<iostream.h>
using namespace std;
class example
{
public:
int a;
example *operator->()
{return this;}
};
int main( )
{
example ob;
ob->a=10;
cout<<ob.a<<" " <<ob->a;
return 0;
}- A.
10 10
- B.
11 11
- C.
Run time error
- D.
Garbage value
Attempted by 380 students.
Sign up free to check your answer
Sign up freeLoading lesson…

