delorie.com/archives/browse.cgi | search |
Date: | Sun, 27 Jul 1997 09:11:03 -0700 (PDT) |
Message-Id: | <199707271611.JAA16856@adit.ap.net> |
Mime-Version: | 1.0 |
To: | zy65 AT dial DOT pipex DOT com |
From: | Nate Eldredge <eldredge AT ap DOT net> |
Subject: | Re: ifstream (FILENAME, ios::binary). Can't Read!!! |
Cc: | djgpp AT delorie DOT com |
You wrote: >A. Sinan Unur wrote > >> > double num_read = 0; >> >> 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. But by definition a file cannot be longer than an unsigned long can specify (and in some cases maybe even only a signed long?) Don't ask how this will work when people want 5GB files... Besides a double loses precision when it counts to high numbers and you don't want that. Moral: use an int type. Nate Eldredge eldredge AT ap DOT net
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |