i want to use unmanaged C++
std::string nodename[100];
this command give following error even though i use #include"string.h"
also
'std' : is not a class or namespace name
i want to use unmanaged C++
std::string nodename[100];
this command give following error even though i use #include"string.h"
also
'std' : is not a class or namespace name
Try something like:
#include <string>
int main(void)
{
std::string nodeName[100];
}
It's just string
, not string.h
.
You're using the wrong header file. You should be #include
ing <string>
, not "string.h"
:
<string>
is the header file that defines the C++ STL class std::string
<string.h>
is the header file for the C standard library of string functions, which operate on C strings (char *
)<cstring>
is the header file like <string.h>
, but it declares all of the C string functions inside of the std
namespaceFor system header files like these, you should always #include
them with angle brackets, not with double quotes.