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

butting two arrays

I have a project where data is received to array a, reformatted to array b, then reformatted to array c. The arrays are different sizes. The process is relevant as different parts of array b are reformatted to array c at different times.

There is a possibility that array a may overflow ever so slightly; however if it overflows into array c, it will not be a problem.

The question is:
can I 'trick' the linker to place array c immeddiately following array a in memory.

Thanx,

Erik

Parents
  • I thought you could do that with the compiler. I think checking "Keep variables in order" in the C51 dialog or ORDER on the C51 command line should do it. Of course you'd then need to define the three arrays in order in a C file, .e.g.

    SomeType arrA[SOME_SIZE];
    SomeType arrB[SOME_OTHER_SIZE];
    SomeType arrC[SOME_DIFF_SIZE];
    - Mark

Reply
  • I thought you could do that with the compiler. I think checking "Keep variables in order" in the C51 dialog or ORDER on the C51 command line should do it. Of course you'd then need to define the three arrays in order in a C file, .e.g.

    SomeType arrA[SOME_SIZE];
    SomeType arrB[SOME_OTHER_SIZE];
    SomeType arrC[SOME_DIFF_SIZE];
    - Mark

Children