vendredi 22 juillet 2016

no return, in function returning non-void {in eclipse CDT}

Save=0;
bool checking() const; ///declaration

inline bool isZombie() const  //definition
{ if(Save==0)   {return cc_t < 0}
  if(Save==1)  {return cc_i < 0;}
}

it's a very naive question. I understand the meaning of the error in the code. Can anyone tell me, why it is not accepting return statements in conditions. if I write the above code as

bool checking() const  //definition
{ if(Save==0)   {return cc_t < 0}
  else {return cc_i < 0;}
}

then, there are no warnings..?

Aucun commentaire:

Enregistrer un commentaire