Groups
Groups
Sign in
Groups
Groups
中正資工,系統程式設計
Conversations
About
Send feedback
Help
關於do{ }while(0);
11 views
Skip to first unread message
魯智深
unread,
May 22, 2023, 12:16:34 AM
5/22/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to 中正資工,系統程式設計
do {
} while(0);
在寫macro的時候常用到,避免使用這個macro的函數中的變數剛好同樣名字
do while(0)相較於{ }來講比較好,比較好的原因我已經忘了,在少數例子裡面{}所提供的namespace是不夠好的
gcc 認得 do{} while0,並不會編譯出多餘的程式碼
Reply all
Reply to author
Forward
0 new messages