C的两个指针问题
1.int *p1 = *(int **)p2;
这个表达式将p2指向的值当做指针类型赋值给p1
,将普通值当做指针值使用
2.*(int **)p1 = p2;
这个表达式将p1指向的值修改为的p2保存的指针
的值,将指针当做普通值使用
这是今天看us/OS的内存管理的时候看到的,真是太精辟了
唉,看来自己的见识还是太少了,以后得加倍努力
相关文档:
引言
C/C++语言有一个不同于其它语言的特性,即其支持可变参数,典型的函数如printf、scanf等可以接受数量不定的参数。如:
printf ( "I love you" );
printf ( "%d", a );
printf ( "%d,%d", a, b );
第一、二、三个printf分别接受1、2、3个参数,让我们看看printf函数的原型:
int printf ( const ......
3: int main()
4: {
5: int i = 1,j;
6: union test{
7: int m;
8: ......
http://os.51cto.com 2008-03-21 11:15 佚名 赛迪网
摘要:学会使用vim/emacs,vim/emacs是linux下最常用的源码编辑器,不光要学会用它们编辑源码,还要学会用它们进行查找、定位、替换等。新手的话推荐使用vim,这也是我目前使用的文本编辑器。
标签:Linux C语言 编程
Or ......
http://docs.google.com/View?docid=ajbgz6fp3pjh_2dwwwwt#_38239340844832237
It is not about optimization.
The whole idea of using 'do/while' version
is to make a macro which will
expand into a regular statement, not into a
compound statement. This is
done in order to make the use of function-s ......
GNU C的一大特色(却不被初学者所知)就是__attribute__机制。__attribute__可以设置函数属性(Function Attribute)、变量属性(Variable Attribute)
和类型属性(Type Attribute)。
__attribute__书写特征是:__attribute__前后都有两个下划线,并切后面会紧跟一对原括弧,括弧里面是相应的__attribute__参数。
__at ......