[Solved] c++ string (nub warning)


Change your include to

#include<string>

The string.h contains functions to manipulate string, but not the std::string class.

#pragma once

Is to prevent headers for being included more then once, leading to duplicated symbols.
In C++, #include means the compiler just replaces the #include with the contents of the file included.

Imagine you have A.h which uses Vector and hence includes Vector.h, and B.h which uses Vector and includes Vector.h.
If C.h would include A.h and B.h, Vector.h is included 2 times.
The compiler will find that the Class Vector is defined twice, and this will cause an error.

With #pragma once, the preprocessor makes sure the file Vector.h is included only once in C.h

solved c++ string (nub warning)