I'm having trouble concatenating a string with a double. It should work fine but it doesn't:

Code:
temp_equ = ( temp_ans + temp_equ.substr( op_indices[counter]+1 ) );
temp_equ is a string.. (a c++ string)

temp_ans is a double.


The weird thing is I created a test project and the following worked fine:
Code:
string s = 3.0 + "asdf";

and

double x = 3;
string s = x + "asdf";
Which is virtually what I'm trying to do.


In my real project I tried the following to make sure it wasn't something to do with the substring:
Code:
temp_equ =  temp_ans + "asdf";
and I still get the following exception:

Code:
67 C:\Dev-Cpp\Projects\Equation Parser\main.cpp invalid operands of types `double' and `const char[5]' to binary `operator+'
What exactly am I doing wrong? It works in another file doing the exact same thing, but not in another...