C/C++的宏定义中使用do{...}while(0)的目的是什么?
首先说明的一点是,这个是百度面试的时候问的一个问题,处于把问题弄透的一个原则,在网络上找了好多资料,其中一个还是比较好的,原文链接:https://www.quora.com/What-is-the-purpose-of-using-do-while-0-in-macros。
Thedo/while(0)pattern seen in many if not most macros in the Linux kernel and elsewhere has a specific purpose: It..
原创
2020-08-29 16:03:22 ·
265 阅读 ·
0 评论