Question: The standard library function strlen() (found in string.h) returns the number ofcharacters in a string, not including the terminating NUL ('0') character. Write your own
The standard library function strlen() (found in string.h) returns the number ofcharacters in a string, not including the terminating NUL ('\0') character. Write your own StringLength() function that does exactly the same thing. Write a shortmain() program to declare and initialize a string. Pass the string toStringLength() to demonstrate that it can return an integer value representing the number of characters in the test string. Use a cout statement in main() to printout the length of the string.
Please note: Your function should count the characters in the string, not accesssome C++ library function or method. DO NOT #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
