linux c之提示format‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat
来源:互联网 发布:linux在线安装gcc 编辑:程序博客网 时间:2024/06/04 23:21
1、问题
有个long int data;我输出的时候printf("data is %d", data);出现下面警告
自己竟然不知道 长整型怎么打印出来,日了狗。
2、解决办法
md,m为指定的输出字段的宽度。如果数据的位数小于m,则左端补以空格,若大于m,则按实际位数输出。
%ld(%mld 也可),输出长整型数据。
最后 printf("data is %ld", data)解决。
最后 printf("data is %ld", data)解决。
3、总结
%md,m为指定的输出字段的宽度。如果数据的位数小于m,则左端补以空格,若大于m,则按实际位数输出。
%ld(%mld 也可),输出长整型数据。
u格式符,用来输出unsigned型数据,无符号数,以十进制数形式输出。格式:%u,%mu,%lu都可
希望以后不要犯下这种傻逼错误。
希望以后不要犯下这种傻逼错误。
0 0
- linux c之提示format‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat
- inet_ntoa编译提示警告: 格式 ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Wformat]
- 编译告警:“warning: format '%d' expects type 'int', but argument 4 has type 'unsigned long'”
- jni编译时出现:warning: format '%d' expects argument of type 'int', but argument 4 has
- [C/C++]warning: format '%c' expects argument of type 'char*', but argument 2 has type 'int' [-Wforma
- 解决 format ‘%x’ expects type ‘unsigned int’, but argument 2 has type ‘int *’
- inet_ntoa warning: format '%s' expects type 'char *', but argument 2 has type 'int'
- g++编译报错原因分析 format ?.d?.expects argument of type ?.nt?. but argument 3 has type ?.
- warning: format ‘%s’ expects argument of type ‘char *’和warning: backslash and newline separated by
- TypeError: argument of type 'int' is not iterable
- Argument of type '(Foo::)(int,int)' does not match 'void (*)(int,int)'以及静态函数问题
- DPDK中文-编译出错 expected __m128i but argument is type int
- expected 'float **' but argument is of type 'float (*)[5]'
- argument of type 'void (main form::)()' does not match 'void (*)(int)'
- warning: non-variable type argument Int in type pattern scala.collection.mutable.WrappedArray[Int] i
- signal 在C++中错误提示 argument of type
- The operator || is undefined for the argument type(s) int, int
- 使用cuDNN5编译py-faster-rcnn错误:cudnn.hpp(126): error: argument of type "int" is incompatible ...
- CountDownLatch使用
- 四旋翼飞行器的飞控实现
- 一些重要概念和设计模式
- 对于系统缺失.NET无法安装MindManager的情况的处理教程
- nginx的多进程模型
- linux c之提示format‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat
- 详解Android的服务
- 《慢慢学TensorFlow》往期内容回顾
- QueryPerformanceFrequency精确获取时间
- Android处理崩溃
- 【VS2015 MFC】bitmap图片加载实现进度条变化
- 《海潮之声》
- C#中Gdal读取SHP文件
- Swift - 按钮(UIButton)的用法