Chinaunix首页 | 论坛 | 博客
  • 博客访问: 151391
  • 博文数量: 44
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 407
  • 用 户 组: 普通用户
  • 注册时间: 2015-11-10 13:28
个人简介

仰望星空

文章分类
文章存档

2016年(22)

2015年(22)

我的朋友

发布时间:2016-03-31 10:10:52

有了虚函数,就可以实现通过基类的指针或者基类的引用调用到派生类的函数,这个太强大了。也就是把通过基类的指针或者引用调用虚函数的代码写在那里不动,将来你新写了派生类并实现了虚函数,那些本来的代码就能调用到你新写的虚函数。点击(此处)折叠或打开#include <iostream>.........【阅读全文】

阅读(1361) | 评论(0) | 转发(0)

发布时间:2016-03-28 21:39:27

一、单目运算符重载#include <iostream>using namespace std; class CPoint{private:    int x, y;public:    CPoint(int _x=0, int _y=0):x(_x).........【阅读全文】

阅读(1400) | 评论(0) | 转发(0)

发布时间:2016-03-13 14:07:06

//文件写入#include #include #include using namespace std; int main(void){    ofstream outfile("f:\\f.txt",ios::out);    if(!ou.........【阅读全文】

阅读(1255) | 评论(0) | 转发(0)

发布时间:2016-03-13 14:05:38

点击(此处)折叠或打开//文件写入#include <iostream>#include <iomanip>#include <fstream>using namespace std; int main(void){    ofstream outfile.........【阅读全文】

阅读(1191) | 评论(0) | 转发(0)

发布时间:2016-03-13 14:02:55

点击(此处)折叠或打开/*#include <iostream.h>#include <fstream.h>// 读取文件d盘的a.txtvoid main(){    char s[5];    ifstream infile("d:\\a.txt",ios::in); .........【阅读全文】

阅读(1214) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册