Answers

Question and Answer:

  Home  C++ Operator Overloading

⟩ What is the output of this program? #include <iostream> #include <string> using namespace std; class test { public operator string () { return "Converted"; } }; int main() { test t; string s = t; cout << s << endl; return 0; } a) converted b) error c) run time error d) None of the mentioned

a) converted

 238 views

More Questions for you: