Exactly, if you wanted to calculate the exact division you should do speed = 99.0/10.0 or speed = 99/10.0. In the last example the compiler will auto-cast the 99 to double because you divide by a double.Originally Posted by code_slinger
| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | VB Forums | Developer.com |
|
Results 1 to 8 of 8
Thread: simple C++ questionThreaded View
|
Click Here to Expand Forum to Full Width |