ExamVeda
Login
Home
C plus plus miscellaneous
?

What will be the output of the following C++ code?
#include <iostream>
using namespace std;
class X 
{
    public:
    int a;
	void f(int b) 
	{
		cout<< b << endl;
	}
};
int main() 
{
    int X :: *ptiptr = &X :: a;
    void (X :: * ptfptr) (int) = &X :: f;
    X xobject;
    xobject.*ptiptr = 10;
    cout << xobject.*ptiptr << endl;
    (xobject.*ptfptr) (20);
}

Answer & Solution
Correct Answer: Option A
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.