自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 简单说下越界访问的调试方法

越界访问的一般提示是 “access violation reading location 0xXXXXXXXX”,翻译过来就是“内存越界访问”。这个提示和一般提示的不同之处是,程序不会停在越界访问的错误行上,而是会停在分配或释放内存的行上,于是就需要我们自己去找到越界行。那要怎么找到越界行呢?这里说一个较为实际的办法:首先根据 函数调用栈 (Call St

2016-11-06 22:15:59 2948

原创 级联继承中返回当前继承层类型的对象

// cascadederivationreturntypeofcurrentderivationlevel.cpp : Defines the entry point for the console application.//#include "stdafx.h"template class A{public: // 以下代码C2355 // 1 try //static

2016-04-25 23:49:54 318

原创 虚函数组实现虚级联继承 - 全开放和(接近)全闭合模式

// 全开放模式// virtualfunctionarrayrealizevirtualcascadederivation.cpp : Defines the entry point for the console application.//#include "stdafx.h"// 高级虚类class A_layer5{protected: virtual void f_

2016-04-25 23:38:02 448

原创 抽象基类运用与抽象基类指针作为模板容器元素

// abstractbasepointerastemplatecontainerelement.cpp : Defines the entry point for the console application.//#include "stdafx.h"// 模板容器template class vector{public: T m[10];};// 抽象基类clas

2016-04-25 23:35:43 487

原创 模板基类派生类的构造函数和析构函数

// constructorofclassderivedfromtemplateclass.cpp : Defines the entry point for the console application.//#include "stdafx.h"template class A{public: A() { } A(T c) { } A(A &a) { } ~

2016-04-25 23:33:46 2384

原创 多态的运用

// polymorphism.cpp : Defines the entry point for the console application.//#include "stdafx.h"class A{public: virtual void f() const { }};class B : public A{public: void f() const ove

2016-04-25 23:32:29 234

原创 C++编译器隐含规则

构造函数的调用:1. 在初始化时调用(构造函数)String str("some text.");2. 在类型转换时调用(转换构造函数)String str = String("some text.");3. 在隐式类型转换作传值函数实参时调用(隐式构造函数)void Print(String str){ printf("%s\n", str.m_str);}Print("

2016-04-25 23:31:23 247

原创 合成拷贝构造函数与拷贝构造函数初始化

// copyconstructor.cpp : Defines the entry point for the console application.//#include "stdafx.h"class A{public: A(){} ~A(){} int v;};class B{public: B(){} //B(B &b) : a(b.a) {} //

2016-04-25 23:26:51 1915

原创 转换构造函数和隐式构造函数

// converthiddenconstructor.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include class String{public: // brief : 构造函数 // param : nil String() {

2016-04-25 23:25:37 1014

原创 重载算术运算符与重载赋值运算符

// overridearithmeticoperatorandoverrideassignoperator.cpp : Defines the entry point for the console application.//#include "stdafx.h"template class Matrix{public: // brief : 构造函数 // param :

2016-04-25 23:24:16 549

原创 重载赋值运算符

// overrideassignoperator.cpp : Defines the entry point for the console application.//#include "stdafx.h"template class Matrix{public: // brief : 构造函数 // param : nil Matrix(int row, int col

2016-04-25 23:22:54 258

原创 具有拷贝构造函数的类作形参

// classwithcopyconstructortobefunctionparameter.cpp : Defines the entry point for the console application.//#include "stdafx.h"class A{public: A() { } A(A &a) { } ~A() { }};void f(

2016-04-25 23:22:19 342

原创 具有内存分配的类的引用作形参

// referenceofclasswithnewoperatortobefunctionparameter.cpp : Defines the entry point for the console application.//#include "stdafx.h"class C{public: C() { str = new char; } ~C() { d

2016-04-25 23:20:50 267

原创 动态参数表作实参调用带动态参数表的函数

// doubledynamic.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include // 动态参数列表作形参int dynamic(int c, char *str, ...){ int len = 0; for(int i = 0; i < c; i+

2016-04-25 23:17:31 336

原创 类成员函数返回值的引用

// classmemberfunctionreturnreference.cpp : Defines the entry point for the console application.//#include "stdafx.h"class C{public: int &member() { value = 1; return value; }public: i

2016-04-25 23:14:40 578

原创 简易函数指针

using namespace std;#include int f(){ return 0;}int function(int (*f)()){ return f();}int main(){ cout<<function(f);}

2016-04-25 23:12:49 194

原创 带动态参数表的函数

// functionthatwithdynamicparameterlist.cpp : Defines the entry point for the console application.//#include "stdafx.h"int ellipsis(...)// 动态参数表{ return 0;}int dynamic(int e, ...)// 动态参数表{

2016-04-25 23:11:34 296

原创 指针的引用作形参

// pointerreferenceasfunctionparameter.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "iostream"using namespace std;typedef struct pos{ int x; int y;

2016-04-25 23:07:23 631

原创 结构体的引用

// structurereference.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "iostream"using namespace std;typedef struct str{ int val; int x; int y;}pos;

2016-04-25 23:05:18 292

原创 函数指针作参数&运算符重载

// functionpointerparameterandoperator.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "iostream"using namespace std;typedef struct pos{ int x; int y;

2016-04-25 23:02:34 355

智能键盘(KeyDirect)

智能键盘(KeyDirect)是一款键盘智能触控感知软件。按下一个键,智能键盘即可将您的键盘转变成触摸屏。 友情提示:如资源分不足可到我的主页上免费下载: http://www.woodenglider.net/c_index.html 源代码也可在链接中找到。

2014-07-07

空空如也

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

TA关注的人

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