Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.
 
hi
thank you very much :)
I'm using 16f877A
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top