搜索资源列表
cmoban
- 参照栈类模板的例子编写一个队列类模板class <T> Queue,私有成员包括:队首指针Front,队尾指针Tail,队列容积max。实现:构造函数Queue,析构函数,入队函数In,出队函数Out(每次出队,后面的元素自动前移一位),判队列空函数Empty。并分别用队列类模板定义int和float对象,调用各个成员函数-reference stack class template examples of the preparation of a class template cl
cclassshape
- 声明一个基类Shape(点), 在此基础上派生出Rectangle(长方形)和Circle(圆),这三个类都有GetArea()函数计算对象的面积,构造函数,析构函数等有关函数。再使用Rectangle类创建一个派生类Square(正方形)。并设计创建各种类的对象,调用所有函数。设计函数f(Shape &a)能对不同对象的实参调用计算打印出对象的面积。 -statement a base class Shape (points) On this basis -- for Rectangle
pet
- 演示类继承,派生的良好教程。可观察构造函数和析构函数的调用顺序,以及冲在构造函数时的参数继承顺序。-demonstration class inheritance, derived from the good guidance. Observed Constructors and Destructors function call sequences, and the structure-function of the parameters of the order of succession.
stack
- 不带头结点的链式堆栈类,1、 定义并实现不带头结点的链式堆栈类,除构造和析构函数外,成员函数还有入栈、出栈、取栈顶元素、判断堆栈是否非空,头文件为“nohead_LinStack.h”。-node does not take the lead in the category of chain stack, 1, and the definition does not take the lead in realizing the chain nodes stack category, In add
circlechain
- 定义并实现带头结点的循环双向链表类,除构造和析构函数外,成员函数还有取数据元素个数、插入、删除、取数据元素-definition and take the lead in achieving the cycle node type two-way linked list, in addition to the structural and destructor function, members also function from the number of data elements, in
数据结构的C++描述
- 目 录 译者序 前言 第一部分 预备知识 第1章 C++程序设计 1 1.1 引言 1 1.2 函数与参数 2 1.2.1 传值参数 2 1.2.2 模板函数 3 1.2.3 引用参数 3 1.2.4 常量引用参数 4 1.2.5 返回值 4 1.2.6 递归函数 5 1.3 动态存储分配
C++程序用类来实现矩阵
- 编写C++程序完成以下功能: (1) 用类来实现矩阵,定义一个矩阵的类,属性包括: 矩阵大小,用 lines, rows(行、列来表示); 存贮矩阵的数组指针,根据矩阵大小动态申请(new)。 (2) 矩阵类的方法包括: 构造函数,参数是矩阵大小,需要动态申请存贮矩阵的数组; 析构函数,需要释放矩阵的数组指针; 拷贝构造函数,需要申请和复制数组; 输入,可以从cin中输入矩阵元素; 输出,将矩阵格式化输出到cout; 矩阵相加的
DynamicArray
- 完成满足上述接口的动态数组(Dynamic array)的程序; 需要遵循基本的编程规范和风格; 动态分配内存用C++的函数new/delete,不用malloc/free; 处理好动态分配的运用,不要出现内存泄漏; 了解C++类的构造函数和析构函数的作用; 熟悉C++类的写法(*.h, *.cpp); 各种情况考虑周到,不要出现程序崩溃; -
string
- 1、为该类设计构造函数和析构函数,要求构造函数不少于两个 2、为该类设计合理的成员变量 3、为string类提供必要的成员函数,可以参考C++类库的string类提供了那些成员函数,起码包括字符查找 获得C风格字符串、获得字符串长度、字符串比较等。 4、要求该类的设计有良好的封装性 5、有一个能正常运行的测试程序,测试该类的所有成员函数-1, the design for the class constructor and destructor, constructor re
TheSTLMap
- map概述,map中的类型定义,map中的迭代器和键值对,map中的构造函数与析构函数,map中的操作方法,再议map的插入操作,multimap-overview map, map of the type definition, map the iterator and value pairs, map in the constructor and destructor, map in the method of operation, and then proposed the inserti
mystring
- 自编string库,包含各类构造函数和析构函数,以及很多字符串操作函数-it s a string.h
exp2_2
- 写出下列程序的执行结果,然后上机进行验证。用VC6的Debug的功能跟踪构造函数、析构函数和成员函数的执行顺序。 -Write the following program execution results, and then verified on the machine. The function of using VC6 Debug trace constructor, destructor and member functions are executed.
BinaryTree
- 二叉树二叉链表实现 (1) 构造(包括拷贝构造)和析构函数(删除所有结点函数); (2) 根据用户输入的先序遍历序列构造二叉树; (3) 打印二叉树(可以使用先序、中序、后序遍历实现); (4) 分别求二叉树中所有结点的个数;叶子结点、分支结点的个数; (5) 分别求二叉树的高度(层次数); (6) 按层次打印二叉树; (7) 使用另一种方式创建二叉树:规则:左子树的值都比根结点小,右子树的值都不比根结点小; -Binary Tree
complex
- complex类加法,减法,乘法,除法运算,重载输出函数,运用友元函数,掌握类的声明和对象的定义; 观察构造函数和析构函数的执行过程; 学习使用Visual C++6.0的Debug调试功能,跟踪观察类的构造函数、析构函数、成员函数的执行顺序。-Complex kind of addition, subtraction, multiplication, and division, operation, an overloaded output function use friend
asd
- 1. 编写程序完成如下功能: ⑴ 编写一个自己的字符串类MyString,它有一个私有的数据成员:指向字符串的指针m_data。编写该类的构造函数、拷贝构造函数和析构函数,在构造函数和拷贝构造函数中动态申请内存空间赋值给m_data。用于存储字符串。在析构函数中释放内存空间。 ⑵ 重载运算符“+”作为类MyString的成员函数,使能完成字符串相加功能。 ⑶ 编写main函数,测试该类及被重载的运算符。-A written procedure performs the fol
linksqelist
- 能够自动调用链表的构造函数和析构函数,能对链表进行插入、删除操作,若不能,则程序能够报错。-The linked list can automatically call the constructor and destructor of the linked list, insert and delete operations, if not, the program is capable of error.
Person
- (3) 设计一个基类Person,包含name和age两个数据成员;由它派生出学生类Student和教师类Teacher,其中学生类添加学号,教师类添加职称信息;每个类均有构造函数和析构函数;编程实现,并用一些数据进行测试。-(3) design a base class Person, contain the name and age of members of the two data derived student class Student and teachers class Tea
MFC
- (1)定义一个抽象基类Shape,同它派生出5个类:圆、正方形、矩形、梯形、三角形。 (2)利用虚函数计算几种图形面积。 (3)演示构造函数、复制构造函数、析构函数的作用和调用顺序 (4)用类模板具体实现。 (5)利用MFC类库在图形用户界面上绘制及修改这些图形,采用对话框输入输出图形的基本属性,或者利用运算符重载输入输出图形的基本属性。 (6)用文件保存图形信息,且能够从文件中读取并作相应处理。 2)创新要求: 采用头文件与源文件分离的方法,多态性的实现多样化-d
The-constructor-and-destructor
- 学习使用构造函数和析构函数的小程序,通过观察运行结果来更好的学习-Learn to use the constructor and destructor small program run by looking to better learning results