- 博客(8)
- 资源 (5)
- 收藏
- 关注
原创 链表类C++
#includeusing namespace std;class CList{private: struct Node { int nValue; Node* pNext; }; Node* pHead; Node* pEnd; int nLength;public: CList() { pHead = NULL; pE
2015-03-23 22:58:30 560
原创 链表在第几个位置添加和删除
#includeusing namespace std;struct Node{ int nValue; Node *pNext;};void CreateList(Node **pHead,Node **pEnd,int n){ int nValue; for(int i=0;i { cin>>nValue; Node *temp=(Nod
2015-03-22 17:33:28 752
原创 链表去重 保留第一个元素
#includeusing namespace std;struct Node{ int nValue; Node *pNext;};void CreateList(Node **pHead,Node **pEnd,int n)//创建链表{ int nValue; for(int i=0;i { cin>>nValue; Node *t
2015-03-21 20:47:26 919
原创 删除链表中和某一个数相同的元素(单向链表)哈理工oj1546
#include#include#includeusing namespace std;struct Node{ int nValue; Node *pNext;};void CreateList(Node **pHead,Node **pEnd,int n){ int nValue; for(int i=0;i { cin>>nValue
2015-03-21 19:35:01 591
原创 函数指针实现多态
#includeusing namespace std;class CFather;//前向声明typedef void (CFather::*PFUN_FATHER)();//定义一个 父类成员函数指针class CFather{ public: PFUN_FATHER *v_ptr;//指向表的指针 static PFUN_FATHER v_table[]
2015-03-20 23:09:41 2035 2
原创 指针题
1.用变量a给出下面各项的定义。 (1) 一个整型数 (2) 一个指向整型数的指针 (3) 一个指向指针的指针,它指向的指针是指向一个整型数 (4) 一个有10个整型数的数组 (5) 一个有10个指针的数组,该指针是指向一个整型数的 (6) 一个指向有10个整型数数组的指针 (7)一个指向数组的指针,该数组有10个指针,每个指针指
2015-03-18 14:11:02 842
原创 C++单例
#includeusing namespace std;class CPeople{ private: static int flag;//判断是否定义了对象 private: CPeople()//构造函数为私有 { } ~CPeople()//析构函数为私有 { CPeople::flag=0;//变量改变 } public :
2015-03-16 22:00:22 432
原创 指针
--------------------------------------------------------------------------------------指向一维函数的指针#include#includeint main(){ int as[3]={11,22,33}; int (*p)[3]=&as; printf("**p=%d\n",**p)
2015-03-08 12:18:49 390
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人