When I got a string defined "string MyString" does this have a MyString[0] or does it start at MyString[1].
Also is a string terminated with a "\0" or NULL character?
When I got a string defined "string MyString" does this have a MyString[0] or does it start at MyString[1].
Also is a string terminated with a "\0" or NULL character?
Like arrays, std::string indices begin from 0.Originally Posted by Crux
std::string does not have the notion of a terminating character. If you use the c_str() member function, you would obtain a pointer to the first character of a string that is terminated by a null character, i.e., '\0'.Originally Posted by Crux
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)