Question: Write a C++ program that includes a function called get_fourth_char which creates a c- string of 5 characters and uses a loop to ask
Write a C++ program that includes a function called "get_fourth_char" which creates a c- string of 5 characters and uses a loop to ask the user to input each character manually. The function should add a null terminator to the end of the string and return the 4th character of the string. In the main function, call the get_fourth_char function and print out the 4th character of the string to the console. Example program output: Enter 5 characters, one at a time: abcde The fourth character of the string is: d
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
