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
Implementations of std::string
hide the memory usage from you. If you're writing performance-critical code, or you actually have to worry about memory fragmentation, then using char* can save you a lot of headaches.
For anything else though, the fact that std::string
hides all of this from you makes it so much more usable.