Question
Complete CapVowels(), which takes a string as a parameter and returns a new string containing the string parameter with the first occurrence of each of
Complete CapVowels(), which takes a string as a parameter and returns a new string containing the string parameter with the first occurrence of each of the five English vowels (a, e, i, o, and u) capitalized. Hint: Begin CapVowels() by copying the string parameter to a newly allocated string.
Ex: If the input is:
management
mAnagEment
#include
// Return a newly allocated copy of original // with the first occurrence of each vowel capitalized char* CapVowels(char* original) { /* Type your code here. */ }
int main(void) { char userCaption[50]; char* resultStr; scanf("%s", userCaption);
resultStr = CapVowels(userCaption);
printf("Original: %s ", userCaption); printf("Modified: %s ", resultStr); // Always free dynamically allocated memory when no longer needed free(resultStr); return 0; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started