Could you run this program please.
Code:#include <stdio.h> int main() { char str[7]; printf("%d %d %d %d\n", sizeof(char), sizeof(short), sizeof(int), sizeof(str)); return 0; }
Could you run this program please.
Code:#include <stdio.h> int main() { char str[7]; printf("%d %d %d %d\n", sizeof(char), sizeof(short), sizeof(int), sizeof(str)); return 0; }
The cost of software maintenance increases with the square of the programmer's creativity. - Robert D. Bliss
The result of this program yields:
1 1 1 7
So it would seem my sizeof function does not work in the same way as most of what I have read online seems to be suggesting.
I am compiling for a DSP Core, made by Ceva called Teaklite.
I am thinking I should try the #pragma pack(1) just to see what the file size results will be... if they are what I expected then its packing. If not, I have 16 bit char types and need to figure out something else.