1.

What is the output of this program?
#include <iostream>
#include <string>
using namespace std;
class Example
{
public:
operator string ()
{
return "Converted...";
}
};
int main()
{
Example examp;
string str = examp;
cout << str << endl;
return 0;
}

A. Compilation Error
B. Runtime Error
C. Converted...
D. Garbage value
E. None of these
Answer» D. Garbage value


Discussion

No Comment Found

Related MCQs