vs2010编译C++静态成员函数的引用
作者:网络转载 发布时间:[ 2015/5/26 15:03:15 ] 推荐标签:软件开发
//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=2;
int_tmain(int argc,_TCHAR*argv[])
{
Tc A(2),B(4);
Tc::display(A);
Tc::display(B);
system("pause");
return 0;
}
本文内容不用于商业目的,如涉及知识产权问题,请权利人联系SPASVO小编(021-61079698-8054),我们将立即处理,马上删除。

sales@spasvo.com