What i meant was like, if i return an object will the return value come out as a reference to that object but you're arent actually returning the actual object?
And also, in this other snippet of code:
Code:
String::~String()
{
delete[] mData;
mData = 0;
}
heres the class definition:
Code:
class String
{
public:
String();
String(const char* rhs);
String(const String& rhs);
~String();
String& operator=(const String& rhs);
private:
char* mData;
};
i dont get why you delete mData, i know that mData points to the dynamically allocated char array but, if we delete mData, is mData alone just the address of char array and not the char array itself?