Question: Hello! Can someone please tell me what is wrong with this C++ code? When I enter a string it doesnt output the correct amount of

Hello! Can someone please tell me what is wrong with this C++ code? When I enter a string it doesnt output the correct amount of characters in the string.

Assignment -

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 functions return value.

Hello! Can someone please tell me what is wrong with this C++

proct 9BMy Mac Finished running project 9B: project 9B ii D project 98 Identity and Type project 9B #include Name main.cpp 3 using namespace std; 5 int countChars(char ) 7 int main) main.cpp Type Default C++Source Products Location Relative to Group main.cpp Full Path /Users ramsesbrazaol Documents/C++ Projects/ project 9B/project 9By main.cpp const int SIZE 100 char userString[SIZE] On Demand Resource Tag8 12 13 14 15 16 17 Only resources are taggable cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!