Quote Originally Posted by mfskratch View Post
We have not learned about "casts" in my class yet... I am still having difficulties.
Well, you have now - at least the first simple version of. A cast is basicly saying to the compiler that "the left side of me is of THIS type, whether you think so or not, so make sure it works". Of course, this is both useful and dangerous, as if you don't quite know what you're doing, you may end up with something that doesn't do what you want.

Converting a float to integer is:
Code:
x = (int) somefloat;
Converting an int to a float is:
Code:
somefloat = (float) x;
In your code, you had (the equivalent of)
Code:
x = int(somefloat)
, which doesn't work.

In your code, it works perfectly fine to completely ignore the "make this integer", because the compiler will provide an adequate conversion ANYWAYS, without complaining even the least bit, so if you have:
Code:
    int x;
    float y, z;
    ... 
    x = y / z;
    ...
this will work just fine - no need to use casts.

--
Mats