怎么说呢, 这是一个作用域的问题! 
成员函数的作用域是类域, 而在类体外加上static不是表示静态函数,表示的是函数拥有文件域(file scope) 
而类域是小于文件域,强行把类域扩大到文件域,就会出错。 
如下代码: 
class CA { 
public: 
static void display(void); 
}; 
		static void CA::display(void) { // ERROR! 
cout < < "Hello CA!" < < endl; 
} 
		int main(int argc, char* argv[]) { 
CA::display(); 
} 
		// error C2724: 'CA::display' : 'static' should not be used on member functions defined at file scope 
	posted on 2009-06-16 15:57 
-274°C 阅读(915) 
评论(0)  编辑  收藏  所属分类: 
C++