Archived

This topic is now archived and is closed to further replies.

Converting Float in Int

This topic is 5152 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Guest Anonymous Poster
Im going to asume your talking about C/C++ since i never heard of aux programming language

for C/C++ to convert a float to an int you use typcasting

if you dont know about typcasting chances are you dont know the c language(wich you should if your trying to do opengl)

im sure i could jsut tell you the answer but it jsut lead to more questions

the C language is easy to learn in a month or so
and learning more as you go

Share this post


Link to post
Share on other sites
if you have an int that wants a floats vaule (rouned down of course)

//declare and give value
int intvar = floatvar

typecasting would be tossing a (int) infront

(int)floatvar

Share this post


Link to post
Share on other sites