Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (myCapacity == 0)
- {
- myArray = new ObjectType[aNewCapacity];
- myCapacity = aNewCapacity;
- return;
- }
- ObjectType *tempArray = myArray;
- myArray = new ObjectType[aNewCapacity];
- if (mySafeModeFlag == false)
- {
- memcpy(tempArray, myArray, sizeof(ObjectType) * ((myCapacity < aNewCapacity) ? myCapacity : aNewCapacity));
- }
- else
- {
- for (SizeType i = 0; i < ((mySize < aNewCapacity) ? mySize : aNewCapacity); i++)
- {
- myArray[i] = tempArray[i];
- }
- }
- myCapacity = aNewCapacity;
- delete tempArray;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement