Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// fichier h
- const StringContent& operator+(const StringContent& s);
- /// fichier cpp
- const StringContent& StringContent::operator+(const StringContent& s)
- {
- std::cout << "operator+" << std::endl;
- int new_size = this->size() + s.size();
- char new_tab[new_size];
- strncpy(new_tab,this->_tab, this->size());
- strncpy(&(new_tab[this->size()]),s._tab, s.size());
- std::cout << "new_tab complet = " << new_tab << std::endl;
- StringContent *nouveau = new StringContent(new_tab);
- return(*nouveau);
- }
Add Comment
Please, Sign In to add comment