This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Array Problem in embedded c

hello , I have a problem regarding array size.I am using keil uvision 4 tool for program.
I read the data from uart and i am trying to save data in the array.But array size is not increasing above 230.It only holds 230 element.but my total data is 550.So I want array of 550 element.what should I do to resolve this problem.

thank you.

Parents Reply Children
  • I think you are confuced about what you can do in C language, you probably are expecting your array to expand automatically like in some high level language where adding a new element will cause automatic expansion of your collection or similar entity.

    You array should have the right size before you try write on it, that is just a basic issue on C language.

  • That is good advice for a beginner - which seems pretty clear to be the case here.

    While there are ways & means to achieve the effect of an "expanding" array in 'C', you really need to get a firm grip on the basics before moving on to advanced topics.

    And receiving data from a UART is a basic topic - there are plenty of examples available on this site, from chip manufacturers, and many other sources...