Quote Originally Posted by armen_shlang
Ok I'm sorry but the answers didn't digest quite well. Even though I'm sure an average person would've got it by now, but I didn't.
Code:
	string& getCompanyName() {return companyName;};
	string& getTitle() {return title;};
What practical purpose would you have of returning a reference to a string? Just return the string.
Code:
	string getCompanyName() {return companyName;};
	string getTitle() {return title;};
What if I want to get the company name, and in some other non-related function, write that name to a file, long after the object is gone? You can't do that with the code you posted, since that reference is tied to the object.

By returning a string, that string can last beyond the life the object.

Regards,

Paul McKenzie