This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS: Memory address of structure members

Tool/software: Code Composer Studio

Hi,

One doubt about the memory address of structure members.

Are the members' address in sequence as their definition sequence? Customer wants to get access to structure members by structure start address. If their memory address follows the definition sequence, customer can do.

Thanks a lot.

Br, Jordan

  • Jordan Zhou said:
    Are the members' address in sequence as their definition sequence?

    Yes.  The C standard requires it.

    Jordan Zhou said:
    Customer wants to get access to structure members by structure start address.

    Consider using the macro offsetof in the C standard header file stddef.h.  I recommend you read about it in your favorite book or web site on C.

    Thanks and regards,

    -George