c语言 7-1

1、

#include <stdio.h>

int main(void)
{
    int n;
    printf("sizeof(1)            = %u\n", (unsigned)sizeof(1));
    printf("sizeof(+1)           = %u\n", (unsigned)sizeof(+1));
    printf("sizeof(-1)           = %u\n", (unsigned)sizeof(-1));
    
    printf("sizeof(unsigned) - 1 = %u\n", (unsigned)sizeof(unsigned) - 1);
    printf("sizeof(double) - 1   = %u\n", (unsigned)sizeof(double) - 1);
    printf("sizeof((double) - 1) = %u\n", (unsigned)sizeof((double) - 1));
    
    printf("sizeof(n + 2)        = %u\n", (unsigned)sizeof(n + 2));
    printf("sizeof(n) + 2        = %u\n", (unsigned)sizeof(n) + 2);
    printf("sizeof(n + 2.0)      = %u\n", (unsigned)sizeof(n + 2.0));
    return 0;
}

 

posted @ 2021-05-16 21:11  小鲨鱼2018  阅读(132)  评论(0编辑  收藏  举报