用dev-c++编译的 是c primer plus 的例题 程序如下: #include <stdio.h> #include <stdlib.h>
int main(void) { unsigned int un = 3000000000; /* 32位int */ short end = 200; long big = 65537; long long verybig = 12345678908426; printf ("un = %u and not %d\n",un, un); printf ("end = %hd and %d\n",end ,end); printf ("big = %ld and not %hd\n", big, big); printf ("verybig = %lld and not %d\n",verybig, verybig); system("PAUSE"); return 0; } 编译出警告:7 [Warning] this decimal constant is unsigned only in ISO C90 10[Warning] integer constant is too large for "long" type up 7 [Warning] this decimal constant is unsigned only in ISO C90 gcc有时候也有这个警告,加上 -std=c99 选项可以通过。 dev-c++没用过
10[Warning] integer constant is too large for "long" type 试试在常数后面加上LL long long verybig = 12345678908426LL;