I am wondering how one would append additional memory to the end of a pointer that already has memory allocated?
For example, if I do something like this...
int *intPtr = new int; // pointer can be assigned 5 values of type int // Now I want to add more memory to the end of this pointer so that it can hold 3 more ints // much like a memory-append
How would this be done properly?
I was thinking that I could get away with sending a reference to a pointer to a method and then allocating memory to that location (intPtr ) but I don't know if there are other more secure methods, or if this one is even ideal.