Straight into business: I have code looking roughly like this:
char* assemble(int param)
{
char* result = \"Foo\" << doSomething(param) << \"bar\
"Foo"
and "Bar"
are literals, they don't have the insertion (<<
) operator.
you instead need to use std::string
if you want to do basic concatenation:
std::string assemble(int param)
{
std::string s = "Foo";
s += doSomething(param); //assumes doSomething returns char* or std::string
s += "bar";
return s;
}