- 博客(2)
- 收藏
- 关注
原创 typeof关键字
typeof是gcc对于标准c的一个扩展,用来获取变量的类型。请看下面的例子: #include int main(){ char* ptr = NULL; typeof(*ptr) chr = w; printf("%c/n", chr); return 0;} 编译并执行:[root@localhost t
2010-04-27 00:55:00
360
原创 linux内核中的list_entry宏
初学linux内核代码,将学习中的一些知识点保存起来,方便以后查阅。 list_entry宏是用来根据list_head指针查找链表所嵌入的结构体的地址,具体查找方法如下: #define list_entry(ptr, type, member) / container_of(ptr, type, member) list_entry只是一层封装,实际上起作用的是c
2010-04-27 00:12:00
636
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅