String::String(const String& old_str) { size = old_str.size; s = new char[size+1];
Why we use size+1 here to allocate memory. why not size?
Aucun commentaire:
Enregistrer un commentaire