#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