I have a problem when concatenating a string type variable with a float, I have the following:
float c1 = 0, c2 = 0, c3 = 0;
std::string best = "";
Then I use it in the following way:
best = "Imagen 1: " + c1;
best = "Imagen 2: " + c2;
best = "Imagen 3: " + c3;
However, it throws me the following errors:
../src/Test.cpp:91:24: error: invalid operands of types ‘const char [11]’ and ‘float’ to binary ‘operator+’
best = "Imagen 1: "+c1;
^
../src/Test.cpp:93:24: error: invalid operands of types ‘const char [11]’ and ‘float’ to binary ‘operator+’
best = "Imagen 2: "+c2;
^
../src/Test.cpp:95:24: error: invalid operands of types ‘const char [11]’ and ‘float’ to binary ‘operator+’
best = "Imagen 3: "+c3;
How could I fix it?