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

Members online

Forum statistics

Threads
474,434
Messages
2,571,685
Members
48,796
Latest member
Greg L.

Latest Threads

Top