一段使用C++的奇怪代码
2008-07-20 10:41
435 查看
linjiangbin02// Dev.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
class A
{
public:
int a;
void ak()
{
int t = 0;
this->a = 9;
}
void Release()
{
delete this;
}
};
class B
{
public:
int b;
};
class C :public B,public A
{
public:
int c;
void ak()
{
int t = 0;
}
};
int main()
{
C* p= new C;
p->ak();
p->Release();
return 0;
}
.
//
#include "stdafx.h"
class A
{
public:
int a;
void ak()
{
int t = 0;
this->a = 9;
}
void Release()
{
delete this;
}
};
class B
{
public:
int b;
};
class C :public B,public A
{
public:
int c;
void ak()
{
int t = 0;
}
};
int main()
{
C* p= new C;
p->ak();
p->Release();
return 0;
}
.
相关文章推荐
- 一段使用 FreeType 在控制台打印字符的 C++ 代码
- 【C/C++】在代码中使用windows性能监视器 .
- java使用JNI调用C++代码(vs2010生成dll文件)
- java/android 使用swig编译c/c++ 代码类型转换
- C++ - goto的使用方法 代码
- 使用HttpWebRequest调用wcf一段代码
- 在C/C++代码中使用SSE等指令集的指令(3)SSE指令集基础
- 在C/C++代码中使用SSE等指令集的指令(5)SSE进行加法运算简单的性能测试
- 使用JNI进行混合编程:在C/C++中调用Java代码
- 举例说明使用MATLAB Coder从MATLAB生成C/C++代码步骤
- Android系统上使用C++开发本地代码
- 一段代码引起的对C++构造函数、析构函数,复制构造函数,运算符重载的深度理解
- 【已解决】一段使用宏定义求结构体偏移量的C代码
- 使用 MATLAB Coder 将 MATLAB 代码生成 C/C++ 代码
- 一段精简的使用 ADODB.Stream 读写"大字段"的 VB 代码
- c++使用c代码
- java中 synchronized 的使用,确保异步执行某一段代码。
- matlab代码到C++代码转化及使用全攻略
- C/C++代码覆盖率工具:gcov和lcov的使用入门
- C++ STL入门教程(2)——list(双向链表)的使用(附完整程序代码)