I have to write a function that accepts a C-string as an argument and returns the length of the C-string as a result. The function should count the number of characters in the string and return that number. This is the code I have:
And this is the error I get:
error C2664: 'strlen' : cannot convert parameter 1 from 'std::string' to 'const char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
I thought the 1st parameter in the function header (StrName) had to be a string, since the string I am inputting in the main (bobString) is a string, right?