开发者

Converting a char array to something that can be appended to a ostringstream

std::开发者_运维问答ostringstream parmStream;
char parmName[1024];
    THTTPUrl::Encode(parmName, pParm->Name().c_str(), 1024);

//I want to add the value of the paramName to the parmStream worked b4 when parmName was a string but obv not now

parmStream << "&" << parmName + "=";

Gives me the following .. error: invalid operands of types \u2018char [1024]\u2019 and \u2018const char [2]\u2019 to binary \u2018operator+\u2019

Cheers for the help in advance


Try

parmStream << "&" << parmName << "=";

I haven't check your code but it looks like the error is pointing to the fact you are trying to add the "=" to a standard C string.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜