What will be the output of the following code?
class A
{
public:
A():pData(0){}
~A(){}
int operator ++()
{
pData++;
cout << "In first ";
return pData;
}
int operator ++(int)
{
pData++;
cout << "In second ";
return pData;
}
private:
int pData;
};
void main()
{
A a;
cout << a++;
cout << ++a;
}
Correct Answer: In second 1 In first 2
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More C++ MCQ Questions