我收到了下面代码标题中提到的编译错误。
#include <iostream>
#include <string>
using namespace std;
class Test
{
std::string name;
public:
Test() {name = "rr";}
Test(std::string input) {name = input;}
std::string PrintName() { return name; }
};
int main()
{
const char* myname = "rr";
Test t1(std::string(myname));
cout << t1.PrintName() << endl;
}
请帮忙