在静态成员函数中调用非静态成员函数:
new一个对象,通过他调用非静态成员函数
class Transship
{
void call(){};
};
static void f()
{
Transship* p = new Transship();
p->call();
}
在静态成员函数中调用非静态成员函数:
new一个对象,通过他调用非静态成员函数
class Transship
{
void call(){};
};
static void f()
{
Transship* p = new Transship();
p->call();
}
转载于:https://my.oschina.net/readerlhx/blog/357612