Xref: utzoo comp.lang.c++:13546 comp.windows.ms.programmer:2564 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!ames!dftsrv!oneel From: oneel@heawk1.gsfc.nasa.gov ( Bruce Oneel ) Newsgroups: comp.lang.c++,comp.windows.ms.programmer Subject: static member functions Message-ID: Date: 20 May 91 14:11:58 GMT Sender: news@dftsrv.gsfc.nasa.gov Distribution: comp Organization: STX/GSFC Nasa Lines: 84 This may be a silly question, but, why is the static needed on member function a in class test? I've found this in both g++ as well as Borland's C++ and I don't understand why from reading the ARM... The error message produced when I remove static from the 4th line in g++ is testcc: In function int main(): test.cc:25: bad argument 0 for functino `test1::b (auto long int (*)(int))' (type was long in (class test::*)(int)) Thanks in advance for all of your help!! bruce This compiles ok. =================CUT HERE ================== class test { public: static long a (int); }; class test1 { public: long b (long (*)(int)); }; long test::a(int i) { return i; } test Atest; test1 Btest; int main(void) { Btest.b(Atest.a); return 0; } =================CUT HERE ================== This doesn't... =================CUT HERE ================== class test { public: long a (int); }; class test1 { public: long b (long (*)(int)); }; long test::a(int i) { return i; } test Atest; test1 Btest; int main(void) { Btest.b(Atest.a); return 0; } ==============CUT HERE================== Thanks!!! bruce -- Bruce O'Neel oneel@heasfs.gsfc.nasa.gov NASA/GSFC/STX/Code 664