Mad*_*tha -2 c++ arrays string
我声明了字符串数组,string pdts[10];但是我收到了声明语法错误.我已经收到了相同的错误.请帮我解决.我的代码是
#include<iostream.h>
#include<string.h>
string pdts[10];
Run Code Online (Sandbox Code Playgroud)
首先,如果你是c ++,你应该这样做:
#include<iostream>
#include<string>
Run Code Online (Sandbox Code Playgroud)
其次,使用:
using namespace std;
Run Code Online (Sandbox Code Playgroud)
或者,使用完全限定名称 std::string