The probelm is only coming from the return type of DateFormat being char* - std::strings can normally be concatenated with string literals without any problem.
E.g. the following works:
std::string a, b;
b = "foo";
a = "literal" + b + "literal";
but the following will not work:
std::string a, b;
b = "foo";
a = "literal" + b.c_str() + "literal";
The only change required should be to convert the result from DateFormat to a std::string.
s="TO_DATE('" + std::string(DateFormat("%d/%m/%Y",Date)) + "','dd/MM/YYYY')";
Should do the trick.
Edit 1
Seeing that DateFormat returns string there should have been no problems concatenating literal + std::string + literal. So I'm stumped.
Edit 2
Following up after Amardeep's noticing that DateFormat actually returns a char* despite the signature suggesting otherwise (nice catch). I tested and it indeed appears no errors or warnings are raised, even compiling with -Wall and -Wextra on gcc, the function behaves as if it were simply defiend char*.
So my solution should still work for the initial reasons. (and there is no actual problem with concatenating string literals with std::string, the problem is only char* with string literals).
It would probably be a neater solution to fix the root of the problem - the bad return type of DateFormat by converting sFormatted to a std::string.
return std::string(sFormatted);