R
Ray Mitchell
Hello,
My understanding is that C++ string class objects still terminate their
strings with a '\0', as do strings in C. If this is the case (please tell
me if it isn't), it appears that the easiest way to treat a C++ string as a
char * so it can be used with functions requiring a character pointer such
as strcmp (I realize that one would not normally want to do this), etc. is
to use the form: &stringObject[0] (is there a better way?). In MFC, one
need to merely cast the CString type to a char *, but this doesn't appear to
be the case with a standard C++ string.
Thanks,
Ray Mitchell
My understanding is that C++ string class objects still terminate their
strings with a '\0', as do strings in C. If this is the case (please tell
me if it isn't), it appears that the easiest way to treat a C++ string as a
char * so it can be used with functions requiring a character pointer such
as strcmp (I realize that one would not normally want to do this), etc. is
to use the form: &stringObject[0] (is there a better way?). In MFC, one
need to merely cast the CString type to a char *, but this doesn't appear to
be the case with a standard C++ string.
Thanks,
Ray Mitchell