Guest User

Untitled

a guest
Jun 18th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. /// fichier h
  2. const StringContent& operator+(const StringContent& s);
  3. /// fichier cpp
  4. const StringContent& StringContent::operator+(const StringContent& s)
  5. {
  6. std::cout << "operator+" << std::endl;
  7. int new_size = this->size() + s.size();
  8. char new_tab[new_size];
  9. strncpy(new_tab,this->_tab, this->size());
  10. strncpy(&(new_tab[this->size()]),s._tab, s.size());
  11. std::cout << "new_tab complet = " << new_tab << std::endl;
  12. StringContent *nouveau = new StringContent(new_tab);
  13. return(*nouveau);
  14. }
Add Comment
Please, Sign In to add comment