finding max value of size_t

  • Thread starter subramanian100in
  • Start date
N

Nelu

You have mentioned "Please quote context". WHat is meant by quoting
context? I do not understand this. Kindly explain.

http://www.netmeister.org/news/learn2quote.html
http://cfaj.freeshell.org/google/

http://www.caliburn.nl/topposting.html - but this one doesn't
seem to work right now.
Now I have a question on SIZE_MAX.

In the ISO C99 statndard document

www.open-std.org.jtc1.sc22.wg14.www.docs.n1124.pdf

in 7.18.3 in page 259
SIZE_MAX is mentioned as 65535

which is (2 raised to the power 16) - 1. Am I right ? But in Redhat
Enterprise Linux gcc implementation, in <stdint.h>, SIZE_MAX value is
defined as 4294967295 which is (2 raised to the power 32) - 1, I
think. I cannot understand this difference. Where am I going wrong.
Please explain

It actually says: 7.18.13-2 "... Its implementation defined value
shall be equal to or greater in magnitude (absolute value) than
the corresponding value given below, with the same sign..." then
it says: SIZE_MAX 65535, which means SIZE_MAX should be at the
very least equal to 65535.
 
S

santosh

Now I have a question on SIZE_MAX.

In the ISO C99 statndard document

in 7.18.3 in page 259
SIZE_MAX is mentioned as 65535

which is (2 raised to the power 16) - 1. Am I right ? But in Redhat
Enterprise Linux gcc implementation, in <stdint.h>, SIZE_MAX value is
defined as 4294967295 which is (2 raised to the power 32) - 1, I
think. I cannot understand this difference. Where am I going wrong.
Please explain

It's value is implementation defined. Different implementations will
each have a suitable value, based on their hardware architecture and
operating system limits, for SIZE_MAX. The Standard specifies the
minimum necessary magnitude.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

size_t in inttypes.h 4
Adding adressing of IPv6 to program 1
usage of size_t 190
size_t, ssize_t and ptrdiff_t 56
Weird result from size_t 5
Max value of a variable 9
return -1 using size_t??? 44
size_t and ptr_diff_t 9

Members online

No members online now.

Forum statistics

Threads
473,955
Messages
2,570,117
Members
46,705
Latest member
v_darius

Latest Threads

Top