Question
1. Write a function void capitalize (char *) that is passed a string and modifies that string to capitalize all lowercase letters in the string.
1. Write a function void capitalize (char *) that is passed a string and modifies that string to capitalize all lowercase letters in the string. I recommend you use the toupper function.
2. Write the function void censor(char *, const char *) that modifies a string (its first argument) by replacing every occurence of a patternn string (the second arguement) with all X's.
Example for #2:
String? hi mom how is it going? See you soon. // defined string
pattern? going //user input
after call to censor: hi mom how is it XXXX? See you soon. //# of X's match number of letters in pattrn string
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