Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
fread/fwrite
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="santosh, post: 2963320"] You can't expect to portably store arbitrarily large values. size_t can store values in the range of 0 ... SIZE_MAX. What's ill-defined about this? Here you're performing an arithmetic calculation without checking for the possibility of wrap-around. Again results might vary across implementations, but this is not exclusive to size_t types. You're comparing objects which might not hold the values intended for them. And in what way is this exclusive to size_t. This is true for all of C's numeric types. Each type's size and range are implementation dependant except that certain minimum values are guaranteed by the Standard. That's the price you'll have to pay for using an efficient, statically typed language. If you want a language with dynamically sized types, there're plenty of them floating around. C was not defined to be such a language. On the other hand, if you stick to what's guaranteed by the Standard, you _can_ achieve a very high level of source code portability. The problem is, you want guarantees the Standard is not providing. <snip> [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
fread/fwrite
Top