开发者

g++ Compile error: missing ';'

I am trying to run this code

开发者_JS百科
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?


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

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


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


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


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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜