A
An Ony
Hi,
Is there a default toString() function in c++ like in java?
Having a class Person with a firstname and lastname attribute.
Can I create something that will printout the name and use it like this?
Person p;
//make it have a name
cout << p;
Or is this too much magic asked and should I just do a p->printMe()
function?
Thx!
(yes, I'm a java programmer)
Is there a default toString() function in c++ like in java?
Having a class Person with a firstname and lastname attribute.
Can I create something that will printout the name and use it like this?
Person p;
//make it have a name
cout << p;
Or is this too much magic asked and should I just do a p->printMe()
function?
Thx!
(yes, I'm a java programmer)