Please and must explain/show work, thank you! c) The following function should a
ID: 3752720 • Letter: P
Question
Please and must explain/show work, thank you!
c) The following function should allocate space for a new string, copy the string from the passed argument into the new string, and convert every lower-case character in the new string into an upper-case character (do not modify the original string). Fill-in the blanks and the body of the for0 loop: char upcase(char str) l char* p; char* result; result - (char*) malloc( strcpy for( p-result; *p!O' p J; D; /* Fill-in 'A - 65, 'a' - 97, 'Z" - 90, 'z 122*/ return result;Explanation / Answer
char *upcase(char *str) { char *p; char *result; result = (char*)malloc(sizeof(char)*(strlen(str)+1)); strcpy(result, str); for(p = result; *p != ''; p++) { if(*p >= 'a' && *pRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.