#include <iostream>
using namespace std;
class A
{
public:
virtual int print()=;
};
class B: public A
{
public:
virtual int get()=;
virtual int print()
{
cout<<get()<<endl;
}
};
class C: public B
{
public:
int get()
{
return ;
}
};
int func(A* a)
{
a->print();
}
int main()
{
C c;
func(&c);
return ;
}
相关文章
- 【C++】多态与虚函数
- Java中调用c/c++语言出现Exception in thread "main" java.lang.UnsatisfiedLinkError: Test.testPrint(Ljava/lang/String;)V...错误
- 使用 LD_PRELOAD 变量拦截调用
- 【C# C++】C#中调用msvcr100.dll中的_beginthreadex函数
- 为什么一定要调用 setlocale 呢? 因为在 C/C++ 语言标准中定义了其运行时的字符集环境为 "C" ,也就是 ASCII 字符集的一个子集。使用setlocal改变整个应用程序的字符集编码方式(wcstombs使用前要设置 setlocale (LC_ALL, "chs"); )
- 使用VS GDB扩充套件在VS上远端侦错Linux上的C/C++程序
- tolua++实现lua层调用c++技术分析
- 以不同用户身份运行程序,/savecred只需要输入一次密码(GetTokenByName取得EXPLORER.EXE的令牌,然后调用CreateProcessAsUser,而且使用LoadUserProfile解决另存文件的问题)good
- 调用C#类的成员函数的时候,编译器有没有插入this指针作为参数(如同C++一样)?
- 使用openstackclient调用Keystone v3 API