cout << \"newCString before changing: \" << oldCString<< endl;
Reverse(newCString, oldCString, STRINGSIZE); // testing yourfunction...
cout << \"newCString after Reverse: \" << newCString<< endl;
return 0;
}
// Reverses a C-string passed in (source), and places thereversed
// C-string into (destination).
// (num) should represent the maximum valid length of(destination).
// If no null-zero character is found in (source) within(num-1)
// characters,the function will only read up to (num-1)characters
// from (source), and then copy the reversed characters to
// (destination) and append a null-zero to the end of it.
// The function will return the number of characters placedinto
// (destination), including the null-zero.
// The function MUST use pointer notation (not array notation)inside
// it. However, you might find it useful to use arraynotation
// temporarily while developing the function, and thenreplace
// with pointer notation before turning in the assignment.
int Reverse(char * destination, const char * source, intnum)
{
for (int x = 0; x < strlen(source); x++)
*( x + destination) = *( strlen(source) + source - 1 - x);
*(destination + strlen(source)) = '\0';
return 0;
}