Mail Archives: djgpp/1997/07/27/15:03:46
A. Sinan Unur wrote:
>
> > > do you ever expect to read a fractional number of bytes from a file?
> >
> > No, I just used it cause I always think of doubles as being able to
> > count to a higher number than ints.
>
> for reasons that are too mundane to explain and take up bandwidth with,
> that is not a good idea. if you insist, you can do it of course, but you
> will be in for a pretty hectic ride.
If, for some reason, you seriously expect that your program might read
more than 4 billion bytes of data from a file, you can use the long long
integer type. This is a 64 bit integer; the upper limit of which is
approximately 1.845 x 10^19. It's gcc-specific, but involves less
overhead than float->int conversions.
BTW, I just wrote a little program to print out the maximum value of a
64 bit integer:
18446744073709551615
Pretty impressive, huh? When computers can hold that many bytes of
information, I'm giving up. ;)
--
---------------------------------------------------------------------
| John M. Aldrich | "If 'everybody knows' such-and-such, |
| aka Fighteer I | then it ain't so, by at least ten |
| mailto:fighteer AT cs DOT com | thousand to one." |
| http://www.cs.com/fighteer | - Lazarus Long |
---------------------------------------------------------------------
- Raw text -