Write aC++ functioncalled ay that makes a copy of a C-string and also adds the two characters "ay" to the end of it. Here is what it should do:
The function can assume that parameterstrpoints to a valid, NULL-terminated C-string. You can use cstring utility functions like strcpy(), strlen(), etc. if you like, but you are not required to. You do not need to demonstrate calling this function.
Example: ay("Giants")should return a pointer to a newly-allocated, null-terminated C-string: "Giantsay"
Your function must have the following signature:
char* ay(char *str)
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here