错误信息:"format '%d' expects a matching 'int' argument" 表示在字符串格式化过程中,%d 占位符期望得到一个整数(int)类型的参数,但实际上没有得到。 可能的问题原因 类型不匹配:提供给 %d 的变量不是整数类型,可能是浮点数(float)、字符串(str)或其他非整数类型。 解决方案 确保传入整数: 确保你传入给 %d...
linux c之提示format‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat 1、问题 有个long int data;我输出的时候printf("data is %d", data);出现下面警告 自己竟然不知道 长整型怎么打印出来,日了狗。 2、解决办法 md,m为指定的输出字段的宽度。如果数据的位数...
[translate] awarning: format ‘%ld’ expects argument of type ‘long int *’, but argument 2 has type ‘long int’ [-Wformat] 警告: 格式`%ld’期待类型`长的int的论据*’,但是论据2有类型`长的int’ (- Wformat)[translate]
warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘time_t {aka long int},程序员大本营,技术文章内容聚合第一站。
include<stdio.h>int main(){int u=32;int v=26;while(v!=0)//;//<==={int temp =u%v;u=v;v=temp;}printf("%d",u);//<===return 0;}
楼主对语法理解是完全错误的 printf("%c\\h,zy")看起来完全不合理 应该是printf("%c", zy)吧?
Cannot carry on the[translate] awarning: format ‘%s’ expects type ‘char *’, but argument 3 has type ‘int’ 警告: 格式`%s’期待类型`炭灰*’,但是论据3有类型`int’[translate]
这个错误是由于在使用printf函数时,格式字符串中使用了%d来表示整数类型的参数,但实际传入的第四个参数是long unsigned int类型,导致编译器报错。 要解决这个问题,你可以将格式字符串中的%d替换为%lu,以正确匹配参数类型。修正后的宏定义如下: #defineLOG_DEBUG(format,...)printf("\033[34m[Debug:%s][Line:%d...
默认的警告等级太高了,可以无视该警告。或者把%d改为%lu。