Re: [問題] 一個 typedef 語法
看板C_and_CPP (C/C++)作者descent (「雄辯是銀,沉默是金」)時間12年前 (2013/12/13 15:48)推噓0(0推 0噓 0→)留言0則, 0人參與討論串4/4 (看更多)
: 推 descent:int(i); 這種語法還真難倒我 12/12 18:46
: 推 descent:那這樣也是正確的嗎? int(i)=5; compile 會過 i=5 12/12 18:48
: 推 jackace:是正確的 n3485 section 8.3 rule 6 12/12 19:59
: → jackace:事實上函式指標的宣告 int (*f)()也是這個rule 透過()將 12/12 20:03
: → jackace:specifier跟declarator分開 12/12 20:03
請問是這段嗎?
In a declaration T D where D has the form
( D1 )
the type of the contained declarator-id is the same as that of the contained
declarator-id in the declaration
T D1
Parentheses do not alter the type of the embedded declarator-id, but they can
alter the binding of complex
declarators.
所以使用了 int(i) 有著和空白一樣的效果 int i 是嗎?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 58.114.140.46
討論串 (同標題文章)
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章