Home »

How do I know how many elements an array can hold?

Question ListCategory: cHow do I know how many elements an array can hold?
alisataylore190 author asked 9 years ago
1 Answers
jully882 author answered 8 years ago

The amount of memory an array can consume depends on the data type of an array. In DOS
environment, the amount of memory an array can consume depends on the current memory

model (i.e. Tiny, Small, Large, Huge, etc.). In general an array cannot consume more than

64 kb. Consider following program, which shows the maximum number of elements an array

of type int, float and char can have in case of Small memory model.

main( )

{

int i[32767] ;

float f[16383] ;

char s[65535] ;

}

Please login or Register to Submit Answer