C++ me g++

The Reverant reverant at freemail.gr
Thu May 3 15:50:14 EEST 2001


Paides xaireto. Paratheto ena mikro programmataki se C++ kai apo kato to 
problima mou:

--cut here---------
#include <iostream>
 
class AClass
{
public:
int aFunc();
};
 
int AClass::aFunc(){}
 
void main()
{
AClass myClass;
int (*pFunc)()=myClass.aFunc;
} 
--cut here---------

To problima einai oti otan pao na to kano compile, pairno to eksis minima 
lathous apo ton g++:

reverant at MagnusII:~ > g++ test.cpp
test.cpp: In function `int main(...)':
test.cpp:17: no matches converting function `aFunc' to type `int (*)()'
test.cpp:10: candidates are: int AClass::aFunc()

Afto pou thelo na kano, einai na exo enan pointer se function, pou na deixnei 
se mia member function tou object myClass (classis AClass). An thimamai kala, 
se VC++ afto ginotan, o g++ petaei error. Ti den kano sosta?

Efxaristo prokatabolika

-- 
The Reverant
(Dimitris Stasinopoulos)



More information about the Linux-greek-users mailing list