I am trying to make all the characters in an array uppercase, however it is giving me an error that says:
cannot convert std :: (aka std::basic string<char>)' to 'const char' for argument 1 to 'size_t strlen(const char*)
This error happens on line 10 and I do not know what the problem is. Any help would be greatly appreciated thanks.
line 1: You're passing an array of std::string objects.
line 10: You can't use strlen() directly on a std::string object. strlen() is a C function that takes a constchar *. To take the length of a std::string, use string.size().
num_chars = array[i].size();
You could use std::string's c_str() function to return a constchar *, but that's mixing C and C++ idioms which is a poor practice.