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 Reply Children
  • "C does not guarantee that there won't be pad bytes added"

    This is true; however, in this specific case, I don't think that Keil C51 ever adds padding bytes (there would be no reason to do so on an 8-bit processor).

    Generally, I think most compilers have an option to prevent the addition of padding bytes?

  • True, on an 8-bit machine without alignment considerations I'd agree with you. I just like to raise portability issues so we all remember what C guarantees. Yes most compilers offer some #pragma pack or __attribute__((packed)) option.