Write a function that returns an integer and accepts a pointer to a C-string as
ID: 3622638 • Letter: W
Question
Write a function that returns an integer and accepts a pointer to a C-string as an argument. The function should count the number of characters in the string and return that number. Demonstrate the function in a simple program that asks the user to input a string, passes it to the function, and then displays the function's return value.The user inputs the string on the keyboard. Remember your supposed to use a pointer to a char USING CSTRING for C. The program needs to use strlen!
Lifesaver given!1
Explanation / Answer
#include #include using namespace std; int Countchar(string ); void main() { string input; int totalcount; coutinput; totalcount = Countchar(input); coutRelated 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.