char* vs std::string | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson

char* vs std::string

May I have a comparison between the mentioned types in the title? When do you use each one? What's the difference? Etc...

18th Aug 2021, 8:52 AM
Yahel - avatar
1 Answer
+ 4
When working with strings in c++, I would usually stick to std::string wherever I can, unless it's necessary to use char* ( like when working with a C library or on very low end system )
18th Aug 2021, 9:01 AM
Arsenic - avatar