Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!att!bellcore!shera!garnett From: garnett@shera..bellcore.com (Michael Garnett) Newsgroups: comp.lang.c++ Subject: Re: Pointers to member functions Keywords: pointer, function, member, class Message-ID: <1991Jan21.083930.2541@bellcore.bellcore.com> Date: 21 Jan 91 08:39:30 GMT References: <1991Jan18.222713.26249@scrumpy@.bnr.ca> Sender: usenet@bellcore.bellcore.com (Poster of News) Reply-To: garnett@shera.UUCP (Michael Garnett) Distribution: na Organization: Bellcore MRE Lines: 13 In article <1991Jan18.222713.26249@scrumpy@.bnr.ca> bnrmtl!stu4@larry.mcrcim.mcgill.edu writes: >I am trying to pass a pointer of a function (that is a member of a >class) to the ftw() function (taken from ). > You can't pass a member function to ftw to call. ftw does not know about your class, and cannot thus provide the "this" paramater. Methods must be called ON an object, ftw has no such object to call your function on. A pointer to the member function showfile of fileclass is of type: int (fileclass::*)(const char*, stat*, int); This is not the same as regular pointers to functions. Michael