detective1711

test

May 22nd, 2014
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. QString::QString(char* c)
  2. {
  3.     count = strlen(c);
  4.     core = _strdup(c);
  5. }
  6. QString::QString(const QString& qs)
  7. {
  8.     count = qs.count;
  9.     core = _strdup(qs.core);
  10. }
  11.  
  12. QString::~QString()
  13. {
  14.     if (core){
  15.         delete core;
  16.         core = NULL;
  17.         //count = 0;
  18.     }
  19. }
  20.  
  21. QString &QString::operator=(QString& qs)
  22. {
  23.     if (this != &qs){
  24.         delete core;
  25.         count = qs.count;
  26.         core = _strdup(qs.core);
  27.     }
  28.     return *this;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment