摘要: 1. 当只写一个空类的时候,编译器会为他声明一个copy构造函数,一个copy assignment函数和一个析构函数。如下:如果写下:class Empty{ };编译器就会实现以下代码:class Empty{ Empty(){} //默认构造函数 Empty(const Empty& rhs ) {} //复制构造函数 ~Empty() {} //析构函数 Empty& operator=( const Empty& rhs ) {} // 复制赋值操作符};编译器产生的是non-virtual函数。默认产生以上四种构造函数。如果要使这些编译器默... 阅读全文
posted @ 2013-07-11 19:40 2011winseu 阅读(412) 评论(1) 推荐(0) 编辑
摘要: #include using namespace std;#define LIST_INIT_SIZE 100#define LISTINCREMENT 10#define OVERFLOW -2#define TRUE 1#define FALSE 0#define OK 1#define ERROR 0#define INFEASIBLE -1typedef int ElemType;typedef int status;//线性表结构typedef struct{ ElemType *elem; int length; int listsize;}SqList;//初始... 阅读全文
posted @ 2013-07-11 10:54 2011winseu 阅读(189) 评论(0) 推荐(0) 编辑