- 博客(7)
- 收藏
- 关注
原创 静态成员和静态成员函数
静态成员和静态成员函数基本概念 普通成员变量每个对象有各自的一份,而静态成员变量一共就一份,为所有对象共享。 静态成员对象不需要通过对象就能访问class CRectangle{public: CRectangle(int i,int j); ~CRectangle(); static void printTotal();protected:private
2016-03-31 16:36:00 428
原创 构造、解析函数
构造函数 构造函数是成员函数的一种,名字与类名相同,不能有返回值(void也不行) 左用是对对象初始化,比如给成员变量赋初值 类可以有多个构造函数没有初始化对象class Complex{public: void set(double r,double i);protected:private: double real,imag;};Complex c1;
2016-03-18 10:47:22 1225
原创 C语言指针
准备复习C指针,本博客长期更新地址和内容概念int main(){ int i=3; int *pointer; pointer=&i; printf("%d",*pointer); return 0;} 输出: 3int main(){ int i=3; int *pointer; pointer=&i; prin
2016-03-17 10:31:11 565
原创 STL之哈希表
unordered_map、unordered_set用法unordered_map列举出几个主要的unordered_map的函数,并用程序列子说明:1、unordered_map::count#include "iostream"#include "vector"#include "string"#include "queue"#include "algorithm"#include
2016-03-14 21:41:35 665
原创 STL之priority_queue
priority_queue用法priority_queue在STL中模拟实现先写一个用STL模板实现的与真正STL的priority_queue用法相似的priority_queue,以加深理解。#include "iostream"#include "vector"#include "string"#include "queue"#include "algorith
2016-03-11 09:35:43 408
原创 类和对象、内联函数、重载
1.C++类和对象类与结构体一样,有相似之处,从今天开始学习。加油。1.1类的声明与对象的创建声明class Student{ public: char *name; int age; public: void print(){ printf("%s--%d",name,age); } p
2016-03-10 09:00:52 584
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人