Maranion / Festo_repo

0 stars 0 forks source link

Chapter 4 Task 18 #59

Closed Maranion closed 3 years ago

Maranion commented 3 years ago

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.

FestoMentorPP2020 commented 3 years ago

Емил Великов: Ок е.