| www.delorie.com/archives/browse.cgi | search |
| From: | Endlisnis <s257m AT unb DOT ca> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: Help! Djgpp, Allegro, Floats and Ints!! |
| Date: | Tue, 7 Jul 1998 18:24:50 -0300 |
| Organization: | University of New Brunswick |
| Lines: | 18 |
| Message-ID: | <Pine.SOL.3.96.980707182255.1851A-100000@sol.sun.csd.unb.ca> |
| References: | <35A18DF3 DOT B7A4007D AT yahoo DOT com> |
| NNTP-Posting-Host: | sol-alt1.unb.ca |
| Mime-Version: | 1.0 |
| In-Reply-To: | <35A18DF3.B7A4007D@yahoo.com> |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
On Tue, 7 Jul 1998, Gareth Evans wrote: ->The compiler refuses because I am not passing Draw_trans_sprite an ->integer. What are the routines (if any) to convert between different ->types of varibles. ->If you have done basic, then an example is INT(.6738528) - this will ->convert the number to 1. float x=1.333; int y; y = (int)x; //This will always round down. y = (int)(x+.5); //This will round properly. This can be done the same for any variable type, just put the type-name in round brackets. Endlisnis [I have a pyramid of wingyness]
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |