![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
Infinity_D
这个作者很懒,什么都没留下…
展开
-
do{...}while(0)的意义和用法
linux内核和其他一些开源的代码中,经常会遇到这样的代码: do{ ... }while(0) 这样的代码一看就不是一个循环,do..while表面上在这里一点意义都没有,那么为什么要这么用呢? 实际上,do{...}while(0)的作用远大于美化你的代码。查了些资料,总结起来这样写主要有以下几点好处: 1、辅助定义复杂的宏,避免引转载 2014-06-16 10:41:31 · 481 阅读 · 0 评论 -
LIB和DLL的区别与使用
转自:http://www.cppblog.com/amazon/archive/2009/09/04/95318.html 共有两种库: 一种是LIB包含了函数所在的DLL文件和文件中函数位置的信息(入口),代码由运行时加载在进程空间中的DLL提供,称为动态链接库dynamic link library。 一种是LIB包含函数代码本身,在编译时直接将代码加入程序当中,称为静态链接库st转载 2015-07-14 14:57:18 · 341 阅读 · 0 评论 -
c++ 遍历lua table方法
//C++代码: #include #include #include using namespace std; bool popTable(lua_State* L, int idx) { try{ lua_pushnil(L); while(lua_next(L, idx) != 0){ int keyType = lu转载 2015-09-02 22:43:41 · 522 阅读 · 0 评论