Arrays don't expose their lengths to the developer. You need to remember the length by yourself in some object and pass it by yourself whenever it is required.
Instead of such "raw" array, you could better use some MFC collections, depending on your goals. Please see:
https://msdn.microsoft.com/en-us/library/942860sh.aspx[
^],
https://msdn.microsoft.com/en-us/library/y1z022s1.aspx[
^].
However, I'm not sure you should use MFC data objects at all, not even MFC strings. You could be bound to using some of them if they are required for MFC UI development you do, but don't know if this is the case or not.
Generally and preferably, you could use standard C++ ("std::") strings and
containers:
http://www.cplusplus.com/reference/string/string[
^],
http://en.cppreference.com/w/cpp/string/basic_string[
^],
http://www.cplusplus.com/reference/stl[
^],
http://en.cppreference.com/w/cpp/container[
^].
—SA