Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2584857
  • 博文数量: 877
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 5920
  • 用 户 组: 普通用户
  • 注册时间: 2013-12-05 12:25
个人简介

技术的乐趣在于分享,欢迎多多交流,多多沟通。

文章分类

全部博文(877)

文章存档

2021年(2)

2016年(20)

2015年(471)

2014年(358)

2013年(26)

分类: Windows平台

2015-06-25 14:53:25

COM实用入门教程
深度探索C++对象模型.pdf


// ConsoleApplication1.cpp : Defines the entry point for the console application.
//


#include "stdafx.h"
#include <iostream>
using namespace std;


class A;


void MyPrint(A* a);


class A
{
private:
int value;
public:
void setvalue(int value)
{
this->value = value;
this->value += 3;
MyPrint(this);
}


void print()
{
cout << value << endl;
}
};


void MyPrint(A* a)
{
a->print();
}




int _tmain(int argc, _TCHAR* argv[])
{
A a;
a.setvalue(33); 
return 0;
}

阅读(810) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~