qq_29136307 2015-06-18 08:16 采纳率: 0%
浏览 1728

为什么下述程序在VC中可编译,在gcc中提示warning

#include
int main ()
{
int a=3,b=4,c=5;
float x=1.2,y=2.4,z=-3.6;
long u=51274,n=128765;
char c1='a';
char c2='b';
printf("a=%2d b=%2d c=%2d\n",a,b,c);
printf("x=%8f,y=%8f,z=%9f\n",x,y,z);
printf("x+y=%5.2f y+z=%5.2f z+x=%5.2f\n",x+y,y+z,z+x);
printf("u=%6d n=%9d\n",u,n);
printf("c1='%c' or %d\n",c1,c1);
printf("c2='%c' or %d\n",c2-32,c2);
}

  • 写回答

7条回答

  • 帘卷西风 博客专家认证 2015-06-18 08:20
    关注

    有什么警告内容啊?警告一般可以不管的

    评论

报告相同问题?