Originally posted by: hans007
i tend to think STL strings are pretty nice to use.
CComBSTR and _Bstr_t are not strings, they are wrappers to BSTR.
the only reason there is a BSTR is for COM and compatibility across VB, c# etc.
that really isnt fair to say those even count. i mean if you are going to count language compatibility wrappers like BSTR , you should count say jstrings in JNI as part of java.
TCHAR
is also not really a string. its a macro for unicode, that automatically converts to char or wchar depending on preprocessor flags
LPSTR
LPCSTR
these 2 are also not really strings. these are pointers and its a typedef of char* and const char*.
LPTSTR is in theory also a tchar pointer similar to those two.
so in reality , the only real string classes that are not pointers, or wrappers, are char* , wchar * , BSTR and std:string and cstring. std string is also really just a generalization of basic_string<char> so its really just a wrapper of char * also. same with std:wstring which is really basic_String<wchar_t>. and cstring is also some sort of wrapper.
so yeah.... theres a lot of conversions and wrappers that have been written over the years. but if you really think about it , since everything supports unicode now, we really only need wstring / wchar_t *. granted java has just String. but its much less flexible a language due to that. C++ strings are just really double or single byte streams and you can do lots of optimizations and such.
You really should like C++. since all these string types are really simple, and are exactly like C. i mean you could implement all of them in C with structs , and extractors and overloading.