小编Lui*_*a13的帖子

'%d'需要类型为'int'的参数,但参数2的类型为'long unsigned int'[ - Wformat =]

我一直收到编译警告,但我不知道如何解决它:

'%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [
Run Code Online (Sandbox Code Playgroud)

程序运行正常,但我仍然收到编译警告:

/* Sizeof.c--Program to tell byte size of the C variable */
#include <stdio.h>

int main(void) {
    printf("\nA Char is %d bytes", sizeof( char ));
    printf("\nAn int is %d bytes", sizeof( int ));
    printf("\nA short is %d bytes", sizeof( short ));
    printf("\nA long is %d bytes", sizeof( long ));
    printf("\nA long long is %d bytes\n", sizeof( long long ));
    printf("\nAn unsigned Char is %d …
Run Code Online (Sandbox Code Playgroud)

c printf compilation sizeof

19
推荐指数
2
解决办法
3万
查看次数

标签 统计

c ×1

compilation ×1

printf ×1

sizeof ×1