Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C++ question

Name: Anonymous 2013-08-28 13:28

Do I use

MyClass::MyClass (const char* description)
{
    this->description = description;
}
MyClass::MyClass (const std::string& description)
{
    this->description = description;
}


or

MyClass::MyClass (const std::string description)
{
    this->description = description;
}


?

Name: Anonymous 2013-08-29 0:06

>>3
Superior code is below: my_class::my_class(std::string const& description)
    : description_(description) {}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List