To use the standard string
class in C++ you need to #include
. Once you've added the #include
directive string
will be defined in the std
namespace and you can refer to it as std::string
.
E.g.
#include
#include
int main()
{
std::string hw( "Hello, world!\n" );
std::cout << hw;
return 0;
}