i've seen lots of sample code where something like this is written:
while i'm under the impression that it should be
it seems very possible use float or double where it "should" be int or long int and everything is fine without unexpected results... (can't do the inverse, though).
are there any potential downfalls to declaring a variable as a float when it's really an int? does it make the app slower or use up memory? anything damaging at all?
Code:
double seconds = 8455944321;
while i'm under the impression that it should be
Code:
long int seconds = 8455944321;
it seems very possible use float or double where it "should" be int or long int and everything is fine without unexpected results... (can't do the inverse, though).
are there any potential downfalls to declaring a variable as a float when it's really an int? does it make the app slower or use up memory? anything damaging at all?