自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(6)
  • 资源 (1)
  • 收藏
  • 关注

原创 引用

一、什么是引用   引用不是定义一个新的变量,而是给某一已有的变量起一个别名,对引用的操作与对变量直接操作完全一样。   引用的格式:   类型 &引用变量名=目标变量名;      【例1】:int a; int &ra=a; //定义引用ra,它是变量a的引用,即别名   说明:   (1)&在此不是求地址运算,而是起标识作用。   (...

2018-05-21 18:42:06 764

原创 Linux下实现进度条和彩色进度条

一、普通进度条#include #include int main() { char buf[101] = {}; int i =0; char *ptr = "|/-\\"; for(i = 0; i < 100 ; i++) { buf[i] = '#'; printf

2018-05-07 17:57:06 354

原创 C++多态之带有虚函数的菱形继承与菱形虚拟继承

一、菱形继承那就先从菱形继承开始复习如下代码:#include&lt;iostream&gt; using namespace std;class A{public: int _a;};class B : public A{public: int _b;};class C : public A{public: int _c;};class D : pub...

2018-05-06 19:19:48 695

原创 C++多态的实现原理

一、多态的概念            多态就是多种形态,C++的多态分为静态多态与动态多态。静态多态就是重载,因为在编译期决议确定,所以称为静态多态。在编译时就可以确定函数地址。动态多态就是通过继承重写基类的虚函数实现的多态,因为实在运行时决议确定,所以称为动态多态。运行时在虚函数表中寻找调用函数的地址。     在基类的函数前加上virtual关键字,在派生类中重写该函数,运行时将会根据对象的实...

2018-05-05 13:22:47 31781 7

原创 C++继承之菱形继承与虚函数

一、单继承&amp;多继承&amp;菱形继承单继承与多继承 单继承:一个子类只有一个直接父类时称这个继承关系为单继承 多继承:一个子类有两个或以上直接父类时称这个继承关系为多继承菱形继承菱形继承引发的问题:数据冗余例:B、C中的_a都是来自于A,其实两个_a是同一个,但是因为B、C各自继承,产生了两份,造成了数据冗余二义性例:由于D继承于B、C,B、C继承于A,所以D中的_a不知道是来自B还是来自...

2018-05-03 12:26:50 1035

原创 C++继承之继承基础

一、继承的相关概念    继承是⼀种复⽤⼿段,在继承关系⾥子类继承父类的成员,由此达到复⽤的⽬的。通过继承定义一个类,继承是类型之间的关系建模,共享公有的东西,实现各自本质不同的东西。二、三种访问限定符&amp;继承关系三、继承的重要说明1.子类拥有父类的所有成员变量和成员函数2.子类就是一种特殊的父类3.子类对象可以当作父类对象使用4.子类可以拥有父类没有的方法和属性四.派生类(子类)的访问控制...

2018-05-02 22:32:39 269

UNIX环境高级编程

    If you are an experienced C programmer with a working knowledge of UNIX, you cannot afford to be without this up-to -date tutorial on the system call interface and the most important functions found in the ANSI C library. Richard Stevens describes more than 200 system calls and functions; since he believes the best way to learn code is to read code,a brief example accompanies each description. Building upon information presented in the first 15 chapters, the author offers chapter-long examples teaching you how to create a database library, a PostScript printer driver, a modem dialer, and a program that runs other programs under a pseudo terminal. To make your analysis and understanding ofthis code even easier, and to allow you to modify it, all of the code in the book is available via UUNET. Advanced Programming in the UNIX Environment is applicable to all major UNIX releases, especially System V Release the latest release of 4.3BSD, including 386BSD. These real-world implementations allow you to more clearly understand the status of the current and future standards,including IEEE POSIX and XPG3.

2017-11-18

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除