Question
I have the C code here and I need to write some functions. Complete the following functions to work with the main. In this program,
I have the C code here and I need to write some functions. Complete the following functions to work with the main. In this program, a user is asked to enter a string, and also is given some options to manipulate the string. Hee are the functions that need to be added:
int countCharacter(char, char[]) - Counts how many times the character (the first parameter) appears in the C-string (array of char) and returns it.
void convertToUppercase(char[]) - Converts all characters of the parameter variables to upper case. (you can assume that there is only characters a-z, and A-Z.
void convertToLowercase(char[]) - Converts all characters of the parameter C-string to upper case. (you can assume that there is only characters a-z, and A-Z.
void reverseString(char[]) - Reverse the characters in the parameter C-string.
void sortCharacters(char[]) - Sort the characters of the parameter C-string in lexical order. (based on their corresponding ASCII number)
void printString(char[]) - Print the parameter C-string horizontally.
#include
#include
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