maximum number of elements on a array can hold

Status
Not open for further replies.

HATHA

New Member
maximum number of elements an array can hold

Hi
what is the maximum number of elements an array can hold in ccs c and hitech pic c
is it 255?
 
Last edited:
Well, I have no experience with those compilers, but the only limitation to an array in C should be the size of the memory. You wont get any error until the linker tries to assign the array to memory and you'll get an out of bounds error.
 
You did not say what uC you were using.

On a processor with banked memory like the 8 bit PICs it is up to the compiler. Unless the compiler is smart about it each array is limited to one bank.

If you want to use large arrays the easy thing to do is use a 16 bit processor. Or if the array data is constant write it to a serial EEPROM.

EDIT: C18 documentaion has info on how to use large arrays. So should other compiler's docs.
 
Last edited:
To add to what 3v0 stated, if the array is a constant array then the limit is the size of your program rom.

Mike.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…