- 博客(3)
- 资源 (1)
- 收藏
- 关注
原创 链表操作之快慢指针
使用包括链表的找环 判断链表相交 找倒数第几个节点。。。。。 代码: #include #include using namespace std; typedef struct node { int data; int size; struct node*next; }node; typedef node* Lnode; void init(Lnode &head
2015-10-24 01:02:00 587
原创 可变参数列表
C语言的可变参数列表没有什么神秘,就是从已知的变量地址根据参数内存的分配是连续的来找出后边的所有参数 不信,你看底下代码 #include using namespace std; //#include typedef char* va_list; #define _INTSIZEOF(n) ( (sizeof(n) + sizeof(int) - 1) & ~(sizeof
2015-10-08 22:40:38 326
原创 引用计数型指针的的简单实现
template class Smart_ptr { public: Smart_ptr(T*p=0):pointer(p),count(new size_t(p==0?0:1)) {} Smart_ptr(const Smart_ptr &rhs):pointer(rhs.pointer),count(rhs.count) { ++ *count; } ~Smar
2015-10-07 17:34:02 475
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人