Question: C language A function return_string with a return type char* is predefined and it takes a char array (source string) as argument. A variable char*
C language
A function return_string with a return type char* is predefined and it takes a char array (source string) as argument. A variable char* result is already declared in the function return_string. Allocate memory for the result variable (using malloc) and copy the source string to it. The function returns the result. Only submit the portion of the code used to allocate memory to the variable result and to copy the string. Hint: strcpy
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
