开发者

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

开发者 https://www.devze.com 2022-12-21 12:46 出处:网络
std::开发者_运维问答ostringstream parmStream; char parmName[1024]; THTTPUrl::Encode(parmName, pParm->Name().c_str(), 1024);
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

精彩评论

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