- 博客(5)
- 资源 (2)
- 问答 (1)
- 收藏
- 关注
转载 UML类图符号 各种关系说明以及举例
UML类图符号 各种关系说明以及举例(转载) 文章出处:http://www.cnblogs.com/duanxz/archive/2012/06/13/2547801.html UML中描述对象和类之间相互关系的方式包括:依赖(Dependency),关联(Association),聚合(Aggregation),组合(Composition),泛化(Generalization),实现
2016-09-26 20:29:47 327
原创 c++动态数组模板实例
Array.h#ifndef ARRAY_H#define ARRAY_H#include //数组类模板定义templateclass Array{private:T* list;//T类型指针,用于存放动态分配的数组内存首地址int size;//数组大小public:Array(int sz=50);//构造函数Array(const Array&a);//复制构造函数~Array();Ar
2016-09-15 15:17:01 1064
原创 const 数据共享与保护
常数据成员 #include using namespace std; class A { public: A(int i); void print(); private: const int a; static const int b;//静态常数据成员 }; const int A::b=10;//静态常数据成员在类外说明和初始化 //常数据成员只能通过初始化列表来获得初值 A::
2016-09-13 10:20:42 310
原创 指针操作去掉字符串的
void clear(char *str) { int i=0; int icount=0; char* p=str; while(*p) { if(*(p)==’,’) { strcpy(str+icount,p+1); }else { ic
2016-09-11 11:40:10 322
原创 指针 内存应用
#include using namespace std; struct STU { int id; char name[10]; }; #define NUM 5 #define SIZE sizeof(struct STU) void setData(char *pdata,struct STU *pStu) { int i=0; char ch='1'; for(
2016-09-11 11:00:35 146
TA创建的收藏夹 TA关注的收藏夹
TA关注的人