
正文
vs2010编译C++ 静态成员函数的引用
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
// CTest.cpp : 定义控制台应用程序的入口点。
// #include "stdafx.h"
#include <iostream>
using namespace std; class Tc{
private :
int a;
static int b;
public :
Tc(int t){
a = t;b = b+t;
}
static void display(Tc C){
cout<<C.a<<' '<<C.b<<endl;
}
};
int Tc::b=;
int _tmain(int argc, _TCHAR* argv[])
{
Tc A(),B();
Tc::display(A);
Tc::display(B); system("pause");
return ;
}






