Advertisement
Guest User

Untitled

a guest
Jan 28th, 2015
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. void Player::addMatchDate(string date){
  2.    
  3.    
  4.     if (nrOfMatches >= 1){
  5.        
  6.        
  7.         string* tmp;
  8.         tmp = new string[nrOfMatches + 1];
  9.  
  10.         for (int i = 0; i < nrOfMatches; i++){
  11.             tmp[i] = matchdates[i];
  12.         }
  13.         tmp[nrOfMatches] = date;
  14.         delete[] matchdates;
  15.         matchdates = tmp;
  16.        
  17.     }
  18.     else{
  19.         matchdates = new string[nrOfMatches + 1];
  20.         matchdates[nrOfMatches] = date;
  21.        
  22.     }
  23.    
  24.     nrOfMatches++;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement