From: "DeHackEd" References: <6c7ltq$ms1$1 AT o DOT online DOT no> Subject: Re: pointer to function ?? Date: Sat, 21 Feb 1998 10:42:30 -0500 Lines: 32 Message-ID: Newsgroups: comp.lang.c++,comp.os.msdos.djgpp,rec.games.programmer To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk ok, here are the ammendments >I have a class witch looks somthing like this : >class Man { > int x,y,z; > --------- > void nextthink(); void (*nextthink)(); >} > >what I need is to be able to do somthing like : >nextthink() = run(); nextthink = run; > >or > >nextthink() = attack(); nextthink = attack; > >later on in the game... > >any ideas ? > > Then, run the function the normal way. nextthink(); // selected function is run, but SHOULD BE initialized