For example, I have a class definition:
#include <string>
using std::string;
class human
{
public:
human(string, string);
private:
string firstName, secondName;
};
Is there a difference in these ways of describing the constructor?
human::human(string fname, string sname)
{
firstName = fname;
secondName = sname;
}
human::human(string fname, string sname)
:firstName(fname), secondName(sname){}