Please help me with the code :Repost

  • Thread starter Thread starter NotYetaNurd
  • Start date Start date
N

NotYetaNurd

please try the following

float F1=1.0f;

float F2=1.0f;

string testString = " "+ ((F1-F2)>0)?"test1":"test2"; //throws error while
compilation

and

float F1=1.0f;

float F2=1.0f;

string testString = ((F1-F2)>0)?"test1":"test2";


Whatz wrong with the first snippet
 
NotYetaNurd said:
please try the following

float F1=1.0f;

float F2=1.0f;

string testString = " "+ ((F1-F2)>0)?"test1":"test2"; //throws error while
compilation

and

float F1=1.0f;

float F2=1.0f;

string testString = ((F1-F2)>0)?"test1":"test2";


Whatz wrong with the first snippet

You've got a bracket in the wrong place. It should be:

string testString = " "+ ((F1-F2)>0?"test1":"test2");
 
Back
Top