64,648
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <string>
int main()
{
std::string tmp;
tmp="123";
std::cout<<tmp<<std::endl;
}
#include <iostream>
#include <string>
int main()
{
std::string tmp(); //这里只是多了一个括号()
tmp="123";
std::cout<<tmp<<std::endl;
}
q.cc: In function 'int main()':
q.cc:7:6: error: assignment of function 'std::string tmp()'
q.cc:7:6: error: cannot convert 'const char [4]' to 'std::string()' in assignment