KEEP K.I.S.S.

tk's blog

do ... while(0) 的使用

tk posted @ Jun 19, 2012 09:43:26 AM in C , 1470 阅读

今天稍微看了下 Ruby 的 array#pack 和 string#unpack 的实现,额,相当复杂(因为 lua 标准库里没有这样的函数实现,所以看 Ruby 的)。然后在其中发现了很多宏定义使用了

#define MACRO(x) do {\
statements; \
} while(0)

这样的形式,蓝后就去百度谷歌看了看,这里就贴链接,不重复解释了,反正是妙用。

do...while(0)的妙用                     http://www.cnblogs.com/flying_bat/archive/2008/01/18/1044693.html

do { … } while (0) what is it good for?       http://stackoverflow.com/questions/257418/do-while-0-what-is-it-good-for

  • 无匹配
  • 无匹配
CBSE Class 2 Hindi Q 说:
Sep 15, 2022 12:23:29 PM

The Hindi Sample Paper is highly helpful in predicting the new exam formats for all types of board-mandated written exams. Students enrolled in the CBSE Board's Class 2 Stage may download and study the solved question bank at home. CBSE Class 2 Hindi Question Paper Every student may improve their test results by studying all topics covered in the CBSE STD-2 Hindi Sample Paper 2023 Pdf.

น้ําเต้าปูปลา ออนไลน 说:
Jan 10, 2023 01:29:02 AM

I recently came across your article and have been reading along. I want to express my admiration of your writing skill and ability to make readers read from the beginning to the end. I would like to read newer posts and to share my thoughts with you. น้ําเต้าปูปลา ออนไลน์

seo service UK 说:
Jan 16, 2024 05:28:19 PM

You possess lifted an essential offspring..Blesss for using..I would want to study better latest transactions from this blog..preserve posting.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter