Quote:
Write a function that takes a char* argument. Using new,
dynamically allocate an array of char that is the size of
the char array that’s passed to the function. Using array
indexing, copy the characters from the argument to the
dynamically allocated array (don’t forget the null
terminator) and return the pointer to the copy. In your
main( ), test the function by passing a static quoted
character array, then take the result of that and pass it
back into the function. Print both strings and both
pointers so you can see they are different storage. Using
delete, clean up all the dynamic storage.
I have a basic understanding of pointers, but I'm totally new to dynamic memory, so I really had no idea what to do with this one. Here's my failing code: