But with a "string" type (which from what I've read is a better way to go since it's available in C++) you get a conversion error with that
sizeof() just returns 4 bytes all the time. I'm sure it's something stupidly simple but I can't find it on Google and my text book doesn't seem to mention much about "string" types.
timvw wrote:No worries, i've always found C/C++ and all the string approaches quite confusing
char *, std::string, TCHAR, BSTR, ...
Yeah there sure are a heck of a lot of different ways of handling strings. It's probably easier to write your own string class and just use that wherever you work with strings
timvw wrote:No worries, i've always found C/C++ and all the string approaches quite confusing
char *, std::string, TCHAR, BSTR, ...
Yeah there sure are a heck of a lot of different ways of handling strings. It's probably easier to write your own string class and just use that wherever you work with strings
Stick with STL...
It's portable across multiple platforms, well tested and efficient as it's gonna get for what it does for you.
STL, because it's implemented using templates not classes (per se), the syntax is a little wonky at first and the addition of iterators complicate things but in the long run you'll grow to really appreciate such a useful library of data structures & container classes.