Back
Close

Another User Conversion

Anonymous
1,163 views

#include<iostream>
using namespace std;
class Person {
public:
Person(const char* stName)
{}
const char* GetName() const
{}
// this is needed for cout << person
operator const char*() const { return "John";}
private:
char* m_stName;
};
int main()
{
Person person("John");
cout << person << endl;
foo();
return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants