-1
()sizeof()が2バイトのshort intではなく4 bytesを返すのはなぜですか? sizeofを使用して変数のサイズを印刷すること
#include <stdio.h>
main()
{
int a = 10,b = 20;
short int c;
short int d = sizeof(c = a+b);
int e = sizeof(c*d); //e holds the value of 4 rather than 2
double f = sizeof(e*f);
printf("d:%d\ne:%d\nf:%lf\n",d,e,f);
}
のsizeof()は2バイトであることを意味するINTのサイズではなく、短い整数を返しているのはなぜ?
[sizeof(short + short)とsizeof(short)のサイズが異なる理由] [https://stackoverflow.com/q/24610737/253056] –