Mail Archives: djgpp/1998/02/21/11:00:25
From: | "DeHackEd" <Not DOT given AT out>
|
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: | <uHdsj8tP9GA.229@upnetnews03>
|
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
|
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
- Raw text -