AnsweredAssumed Answered

sizeof() function

Question asked by obid.matic on Apr 8, 2016
Latest reply on Apr 9, 2016 by dembek.radoslaw.001
Hello.

I would like to get a size of a struct in bytes. Members of a struct are different - concretely I have 6 WORDS and 1 array of 6 BYTES. Then, the size of a struct would be 30 BYTES. If I use function sizeof(struct), it returns 32, which obviously counts array as 8 BYTES  (2 WORDS).

Is there any other option how to get the proper size in bytes? I use Keil MDK, if it depends on that.

Thank you in advance.

Outcomes