MG wrote:
Why and in what situations is CString not preferred?
CString is not preffered as its pretty heavy in terms of string
manipulation..
e.g. it allows the "+" operation on strings...and ppl have tendency of using
the + operation lousily...
what they tend to forget is that this operation requires a memory
alloc...copying the strings and freeing the memory earlier used...
and its due to this reason...for good programming...CString should be
avoided..
what are you talking about?
CString is a string class like std::string or many other string classes
out there. It does it's job. And if the job requires 2 strings to be
catanated and the operator+ is the method to do it, well, then I guess
this is what needs to be done. And guess what: every string class you can
imagine will have to handle the case of allocating memory for the result,
this is nothing specific to CString.
The reason we don't talk about CString in this NG is that it is a
proprietary string class like many others. There is exactly one string
class which is standard and comes with every decent C++ compiler: std::string
Thats the one we talk about in that NG.
--
Karl Heinz Buchegger
kb******@gascad.at