If I use something like double to hold file sizes in bytes, this will naturally fail very soon, so which data type would I use? Nowadays a couple of TB are common, so I’d like the data type to be able to hold a number that big.
If I use something like double to hold file sizes in bytes, this will
Share
It will depends on you platform. On Unix System, you can probably use the
off_ttype. On Windows, you’ll probably want to useLARGE_INTEGER. Those are the types used on those system by the function returning the file size (staton Unix,GetFileSizeon Windows).If you want a portable type,
uint64_tshould be large enough.