引用:
作者嚐起來像雞
Borland 非常肥大,啟動很慢....
寫命令列的我都用VC 6....
可是VC6有個大BUG....
for ( int i=0; i<2; i++ )
{
//...
}
int i=0; //VC顯示錯誤
很明顯地第一個i 是個區塊變數 (= = 可以這樣叫嗎),
生於for,死於for,
第二個i宣告時VC會跟你說變數重複宣告....
很鳥!
|
我用MS Visual Studio 2003 裡的 VC.NET(7.0) 試過了,
已經不會出現error了,執行也正確,
但在default warning level 3下,還是會給個warning:
warning C4288: nonstandard extension used : 'i' : loop control variable declared in the for-loop is used outside the for-loop scope; it conflicts with the declaration in the outer scope