[ Rato iks de @ 10.03.2010. 20:25 ] @
Imam problem sa sledecom kodom:

void (myClass::*PMF) ();
PMF=myClass::ShowMember;

Kasnije pravim objekte tj. obj1,obj2,obj3.

myClass obj1;
(obj1.*PMF) ();
cout<<"Static: " << myClass::GetStatic() << endl; itd.

Kompajler mi izbaci grsku da ne mogu da koristi clanove funkcije void myClass::ShowMember()
i da ne mogu da konvertujem void myClass u void myClass::*PMF
Zelim ovde da napravim pointer za pristup podatku i da upotrebim taj pointer za prikaz tog podatka.
Ako moze pomoc kako da rijesim ovaj problem.

Jos samo jedno.Kako da napravim CODE i da tu napisem kod a da nekucam ovako kodove.
Izgleda CODE: //pa ovde ide kod .Valjda sam bio jasan.
HVALA
[ kiklop74 @ 10.03.2010. 21:08 ] @
Procitaj ovaj FAQ: http://www.parashift.com/c++-faq-lite/pointers-to-members.html

Posebno ovaj deo:

Citat:

[33.1] Is the type of "pointer-to-member-function" different from "pointer-to-function"?

Yep.

Consider the following function:

int f(char a, float b);

The type of this function is different depending on whether it is an ordinary function or a non-static member function of some class:

* Its type is "int (*)(char,float)" if an ordinary function
* Its type is "int (Fred::*)(char,float)" if a non-static member function of class Fred

Note: if it's a static member function of class Fred, its type is the same as if it were an ordinary function: "int (*)(char,float)".