摘要: 转载表明作者出处:http://www.chinaunix.net 作者:scutan 发表于:2008-06-22 18:20:511. 首先,在C语言中函数是一种function-to-pointer的方式,即对于一个函数,会将其自动转换成指针的类型.如:#include void fun() ... 阅读全文
posted @ 2014-04-15 15:06 StevenSuo 阅读(166) 评论(0) 推荐(0) 编辑
摘要: clone函数很重要,要使用句柄类该是不可避免的需要定义clone函数 回想为什么要使用句柄类,一开始,想用multiset来存储某个类的一些对象,这些对象可能存在父子关系,所以不能直接存放对象(子对象转化为父对象将丢失派生部分),那么只能存放指针,然而指针的管理麻烦(这点我倒是不清楚到底有多难)... 阅读全文
posted @ 2014-03-26 11:25 StevenSuo 阅读(305) 评论(0) 推荐(0) 编辑
摘要: #include#includeint main(){ printf("char arg1[]={\"one1\"}\n"); char arg1[]={"one1"}; printf("%s\n\n",arg1); printf("char *arg2={\"one2\"}:\n"); char ... 阅读全文
posted @ 2014-03-07 17:30 StevenSuo 阅读(124) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/roma823/article/details/6403573下面这篇文章讨论clock_t与time_t的区别http://www.cnblogs.com/chenyadong/archive/2011/12/03/2274783.html但是我这个代码在... 阅读全文
posted @ 2013-12-13 14:29 StevenSuo 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 先上代码#include #include double add(double a, double b){ return a+b; } double sub(double a, double b){ return a-b; } double mul(doubl... 阅读全文
posted @ 2013-11-03 15:18 StevenSuo 阅读(128) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/dzry/archive/2011/05/12/2044835.html 阅读全文
posted @ 2013-11-01 21:55 StevenSuo 阅读(71) 评论(0) 推荐(0) 编辑
摘要: 啥也不说了,直接走链接,http://www.cnblogs.com/dolphin0520/archive/2011/08/25/2153720.html 阅读全文
posted @ 2013-11-01 16:56 StevenSuo 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 没事上在网上看到网友提问指针加减的问题,看到个很有意思的现象——变量声明和地址的关系,大胆猜测一下,望指正。下面两个小程序的输出是什么?//code 1#includevoid main(){ int a=1,b=2,c=3; int *p=&a; *(p++); printf("a=%d,b=%d... 阅读全文
posted @ 2013-10-31 15:28 StevenSuo 阅读(126) 评论(0) 推荐(0) 编辑