【发布时间】:2010-10-28 15:13:24
【问题描述】:
我有以下功能
void AddNodeValue(XMLNode& node, std::string& value);
我想这样使用它:
document.AddNodeValue(modvalue,"modvalue");
编译器抱怨:
error C2664: 'void XML::XMLDocument::AddNodeValue(XML::XMLNode &,std::string &)' : cannot convert parameter 2 from 'const char [9]' to 'std::string &'
A reference that is not to 'const' cannot be bound to a non-lvalue
我不明白为什么这是错误的?
编译器:VS2003
【问题讨论】: