when I try
printf("sizeof(int)= %d\n",sizeof(int));
it gives me 0! what is this about?
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.
when I try
printf("sizeof(int)= %d\n",sizeof(int));
it gives me 0! what is this about?
Hello,
Without more details, it is difficult to answer your question. The details we need are mentioned here:
http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/3131.aspx
At minimum, the full CCS version number, compiler version number and device you are building for is needed.
Thanks
ki
Assuming you are using the latest version of v4, I tried this out with CCSv4.2.5 and using CGT version 4.3.8 and I didn't see any issue with this. I saw a value of '1', which is correct. If you are not using the latest v4 version, please update to it. If you are and still see problems, please attach a reproducible test case.
Thanks
ki
The size returned by sizeof is of type size_t, which doesn't match the format specifier %d, which is for signed int. You need to cast the result of sizeof to match the format specifier, like so:
printf("sizeof(int)= %d\n",(int)sizeof(int));