#include
#include
void f(n){
int a[n];
a[n]=12;
printf("%d\n",a[-1]);
return;
}
int main(){
f(5.5);
return 0;
}
gcc居然编译通过。怎么回事。请高手指点
gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
Target: x86_64-linux-gnu。
Thread model: posix
C 语言问题
所有跟帖:
•
粘贴错误
-brakepad-
♂
(174 bytes)
()
10/31/2008 postreply
12:58:57
•
头文件 显示不出来
-brakepad-
♂
(0 bytes)
()
10/31/2008 postreply
13:00:10
•
当然通过,浮点数cast到整数 -1就是18446744073709551615
-tty-
♂
(0 bytes)
()
10/31/2008 postreply
14:23:11
•
-1是4294967295 如果用32位整数
-tty-
♂
(0 bytes)
()
10/31/2008 postreply
14:29:52
•
回复:当然通过,浮点数cast到整数 -1就是18446744073709551615
-brakepad-
♂
(49 bytes)
()
10/31/2008 postreply
17:24:40
•
在C里,不声明类型就默认是整数 变量数组是C99的新玩艺
-tty-
♂
(0 bytes)
()
10/31/2008 postreply
17:58:34
•
"不声明类型就默认是整数" 是某个版本的新东西,还是一直是这么定义的
-brakepad-
♂
(0 bytes)
()
10/31/2008 postreply
18:29:26
•
一直这样定义的
-tty-
♂
(0 bytes)
()
10/31/2008 postreply
21:03:49
•
回复:在C里,不声明类型就默认是整数 变量数组是C99的新玩艺
-tty-
♂
(56 bytes)
()
10/31/2008 postreply
18:48:48
•
你还不如用:“踢踢歪”
-奉旨灌水-
♀
(15 bytes)
()
10/31/2008 postreply
19:16:29
•
7~tty_write_message(tty, ": warning, "); 还有 (图)
-tty-
♂
(148 bytes)
()
10/31/2008 postreply
22:38:26