views:

52

answers:

1
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

+1  A: 

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.

Goz
Cheers as you can see I'm very much in the early stages of c++
wmitchell
If you want to concatenate strings in C++ at least one of them must be a `std::string` (the other is optional as the compiler will find `operator+` for 2 `std::string` and will implicitly convert the other argument. In your code (I am not recommending, just stating): `std::string(parmName) + "="` will explicitly convert the first array into a `std::string` and then implicitly convert and append the `"="`
David Rodríguez - dribeas