Skip to content

Instantly share code, notes, and snippets.

@Mischa-Alff
Created October 29, 2014 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mischa-Alff/b51f81863dd05606085d to your computer and use it in GitHub Desktop.
Save Mischa-Alff/b51f81863dd05606085d to your computer and use it in GitHub Desktop.
string* addEntry(string* dynamicArray, int& size, string newEntry)
{
string* newArray = new string[size+1];
memcpy(newArray, dynamicArray, size*sizeof(string));
newArray[size]=newEntry;
delete[] dynamicArray;
return newArray;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment