I would like to use the string class.
Should I also involve using namespace std;?
I thought #include <string> would be enough but in CLion when only one of these two (namespace or include) is absent, there are some errors.
What makes things more complicated, is that there is <string> or <strings.h>. What's the difference?
<string> is C++ and provides the std::string class.
<string.h> is C (the C++ equivalent is <cstring>) and only provides functions to work on char*.
Don't use using namespace std; (see the C++ Core Guidelines).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With