0

I am trying to run this code

tResults = itos(Freq)+"\t"dtos(maxTemp)+"\t"+dtos(xB * FP.parU[1])+"\t"+dtos(xH * FP.parI[1])+"\t"+dtos(FP.parI[1]);

string MaxResults::itos(int i) 
{
    stringstream s;
    s << i;
    return s.str();
}

string MaxResults::dtos(double i) 
{
    stringstream s;
    s << i;
    return s.str();
}

and when I try to compile, g++ tells me

 error: expected `;' before ‘dtos’

but I don't see where I would need a semicolon in there. Is there a concept that I'm missing, or am I just an idiot?

mrswmmr
  • 2,081
  • 5
  • 21
  • 23

4 Answers4

4

tResults = itos(Freq)+"\t"dtos(maxTemp)

Missing a plus between the tab and dtos(maxTemp)...

holtavolt
  • 4,378
  • 1
  • 26
  • 40
3

You're missing a + after the first "\t".

Peter Alexander
  • 53,344
  • 14
  • 119
  • 168
2

The problem is in the first line: "\t"dtos(maxTemp) is missing a +.

mkarasek
  • 22,309
  • 2
  • 21
  • 10
2

You have missed a + in front of the first dtos

//                    vvvvvvvv
tResults = itos(Freq)+"\t"dtos(maxTemp)+"\t"+dtos(xB * FP.parU[1])+"\t"+dtos(xH * FP.parI[1])+"\t"+dtos(FP.parI[1]);

By the way, how is tResults declared? Are you sure, that you know what this row does?

Kiril Kirov
  • 37,467
  • 22
  • 115
  • 187