0

How could i know the total elements an array can store???
whether it depends on the datatype or os(32bit or 64bit)???

3
Contributors
5
Replies
7
Views
7 Years
Discussion Span
Last Post by Narue
0

>How could i know the total elements an array can store???
You're guaranteed at least 65535 / sizeof(T) where T is the type of the array. 65535 is the minimum limit for an object in C.

0

Narue, out of interest what is the convention for this kind of thing? I just found this link which gives the specific sizes for each platform, I'm just intrigued as to why it has to be 2^16 minimum.

0

>I'm just intrigued as to why it has to be 2^16 minimum.
That's simply the standard's minimum limit for objects. A conforming implementation must support at least that much. The idea is that the minimum limits should support the maximum number of platforms.

0

Makes sense really; where could I find the standards for this sort of thing? Will probably come in handy over the next couple of months.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.