samedi 4 avril 2015

Differentiate between float and double


//assume there is no Print(double dValue)
void Print(unsigned int nValue);
void Print(float fValue);
Print(3.14159);


Shouldn't the Print(3.14159) match with Print(float) ?


Instead of it, this code lead to an ambiguous match



  • Is 3.14159 a double ?

  • How to differentiate between float and double ?


Aucun commentaire:

Enregistrer un commentaire