Subject:
|
Re: How do you convert a int to a long or float?
|
Newsgroups:
|
lugnet.robotics.handyboard
|
Date:
|
Thu, 26 Sep 1996 04:25:31 GMT
|
Original-From:
|
Fred G. Martin <fredm@media.SPAMCAKEmit.edu>
|
Viewed:
|
1529 times
|
| |
| |
> I need to convert a int to either a long or float. I've always had a
> compiler that auto converts. I don't remember how to do it. I'd welcome
> any help.
Coercion is done by putting the type you want to convert it to in
parens before the thing being converted; e.g.:
float f = (float) 33;
int i = (int) 10.;
best,
Fred
|
|
Message is in Reply To:
2 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|