cstring 编译出错
代码#include <iostream>
#include <cstring>
//#include <string>
using namespace std;
string s;
int main()
{
string s2;
cout<<s<<endl; //Err
cout<<s2<<endl;
return 0;
}
编译的时候到Err处就会有提示
error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::a
llocator<char> >' (or there is no acceptable conversion)
但使用
#include <string>
时就能顺利通过 不知道原因