[問題] 關於C++ Standard中的一小節

看板C_and_CPP (C/C++)作者 (WSChin)時間14年前 (2011/08/22 21:38), 編輯推噓1(102)
留言3則, 3人參與, 最新討論串1/2 (看更多)
C++ Standard的3.5.10節看不太懂,原文如下: After all adjustments of types(during which typedefs(7.1.3) are replaced by their definition), the type specified by all declarations referring to a given object or function shall be identical, except that declarations for an array object can specify array types that differ by the presence or absence of a major array bound(8.3.4). A violation of this rule on type identify does not require a diagnostic. 我的翻譯如下: 在所有的型別調整之後(在typedefs被他們的定義取代後),所有宣告所特徵的型別若是 參照到給定的物件或函式就必須相同,除非是宣告的物件陣列的型別會因為major array bound的有無而改變。此規則的違背並不需要丟出診斷訊息。 可是.....我自己對於內容還是一知半解,有強者大大可以說明一下這小節的內容嗎? 感謝! 看了兩天還是不懂TT -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.114.27.146

08/22 21:47, , 1F
會不會是extern variable和他的entity型別要一樣?
08/22 21:47, 1F

08/22 21:55, , 2F
大致上是,不過我回個完整解說版 xD
08/22 21:55, 2F

08/22 22:13, , 3F
期待 too... XD
08/22 22:13, 3F
文章代碼(AID): #1EKblMg6 (C_and_CPP)
文章代碼(AID): #1EKblMg6 (C_and_CPP)