Char pointers or strings

If you were making a password generator.

Would you make the password a string or a char pointer ?

You should always prefer std::string over char* or c-strings of any sort unless you are forced to do otherwise by a legacy API. And even then, std::string::c_str() is sufficient almost always.

C++ string objects are significantly simpler and less error-prone than arrays.

Oh ok great. Thanks for the information.
Topic archived. No new replies allowed.