I\'m a C programmer trying to write c++ code. I heard string
in C++ was better than char*
in terms of security, performance, etc, however sometimes it
String may actually be better in terms of performance. And innumerable other reasons - security, memory management, convenient string functions, make std::string an infinitely better choice.
Edit: To see why string might be more efficient, read Herb Sutter's books - he discusses a way to internally implement string to use Lazy Initialization combined with Referencing.