问答详情
源自:3-3 不同型号的容器:基础数据类型

运行报错怎么办

index.cpp:5:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
     printf("int: %d\n", sizeof(int));


提问者:Hunter2917 2023-04-02 22:10

个回答

  • 辉同
    2023-04-20 17:26:41

    printf("int: %d\n", sizeof(int));

    修改为:

    printf("int: %ld\n", sizeof(int));