Thursday, December 17, 2009
Monday, December 14, 2009
Why switch expression does not work with float types?
Posted by
Jp
at
Monday, December 14, 2009
Have you people ever thought of why switch statement does not work with float/double types?
I have read in text books about the constraints of switch statements but i have never thought(infact i didnt take pain to find it out :P) why switch cant be used with floating point values,
but today one of my friend asked me about it(she is doing civil engg)as she has a viva tomorrow on c programming.I was not able to answer her immediately,i searched a lot and i found some answers.I would like to share it with everybody.
The reason is...
I have read in text books about the constraints of switch statements but i have never thought(infact i didnt take pain to find it out :P) why switch cant be used with floating point values,
but today one of my friend asked me about it(she is doing civil engg)as she has a viva tomorrow on c programming.I was not able to answer her immediately,i searched a lot and i found some answers.I would like to share it with everybody.
The reason is...
Subscribe to:
Posts (Atom)