Mail Archives: djgpp/1999/02/27/15:41:52
| From: | "<------------------------" <Nospam AT Nospam DOT com> | 
| Newsgroups: | comp.os.msdos.djgpp | 
| Subject: | Pointers to functions. | 
| Date: | Sat, 27 Feb 1999 20:12:13 -0000 | 
| Organization: | Customer of Planet Online | 
| Lines: | 133 | 
| Message-ID: | <7b9jku$o7o$1@news6.svr.pol.co.uk> | 
| NNTP-Posting-Host: | modem-10.benadryl.dialup.pol.co.uk | 
| Mime-Version: | 1.0 | 
| X-Trace: | news6.svr.pol.co.uk 920146398 24824 62.136.54.138 (27 Feb 1999 20:13:18 GMT) | 
| NNTP-Posting-Date: | 27 Feb 1999 20:13:18 GMT | 
| X-Complaints-To: | abuse AT theplanet DOT net | 
| X-Newsreader: | Microsoft Outlook Express 4.72.3110.1 | 
| X-MimeOLE: | Produced By Microsoft MimeOLE V4.72.3110.3 | 
| To: | djgpp AT delorie DOT com | 
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp | 
| Reply-To: | djgpp AT delorie DOT com | 
This is a multi-part message in MIME format.
------=_NextPart_000_0058_01BE628D.7706D5C0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
I'm in the process of writing a (very primitive) scrolling shoot-em-up =
like space invaders,
and in designing the core of the sprite moving program, I have chosen to =
have every object
call it's update function each frame. All the objects share a common =
data type, so I wanted
to use function pointers. The problem is, I've never uesd them before. =
Just wanted to know
how to prototype them (if any changes are needed) and how to specify =
them in my object_t
structure. I'd also appreciate any help in how I'm supposed to assign =
functions to the pointers,
and how to call those functions.
Thanks!
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
         Please reply to News Group
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
------=_NextPart_000_0058_01BE628D.7706D5C0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>
<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><STRONG><EM><FONT color=3D#000000 face=3D"Times New Roman"=20
size=3D2></FONT></EM></STRONG><STRONG><EM><FONT color=3D#000000=20
face=3D"Times New Roman" size=3D2>Hi,</FONT></EM></STRONG></DIV>
<DIV><STRONG><EM><FONT color=3D#000000 face=3D"Times New Roman"=20
size=3D2></FONT></EM></STRONG> </DIV>
<DIV><STRONG><EM><FONT color=3D#000000 face=3D"Times New Roman" =
size=3D2>I'm in the=20
process of writing a (very primitive) scrolling shoot-em-up like space=20
invaders,</FONT></EM></STRONG></DIV>
<DIV><STRONG><EM><FONT color=3D#000000 face=3D"Times New Roman" =
size=3D2>and in=20
designing the core of the sprite moving program, I have chosen to=20
</FONT></EM></STRONG><STRONG><EM><FONT color=3D#000000 face=3D"Times New =
Roman"=20
size=3D2>have every object</FONT></EM></STRONG></DIV>
<DIV><STRONG><EM><FONT color=3D#000000 face=3D"Times New Roman" =
size=3D2>call it's=20
update function each frame. All the objects share a common=20
</FONT></EM></STRONG><STRONG><EM><FONT color=3D#000000 face=3D"Times New =
Roman"=20
size=3D2>data type, so I wanted</FONT></EM></STRONG></DIV>
<DIV><STRONG><EM><FONT color=3D#000000 face=3D"Times New Roman" =
size=3D2>to use=20
function pointers. The problem is, I've never uesd them before.=20
</FONT></EM></STRONG><STRONG><EM><FONT color=3D#000000 face=3D"Times New =
Roman"=20
size=3D2>Just wanted to know</FONT></EM></STRONG></DIV>
<DIV><STRONG><EM><FONT color=3D#000000 face=3D"Times New Roman" =
size=3D2>how to=20
prototype them (if any changes are needed) and how to specify=20
</FONT></EM></STRONG><STRONG><EM><FONT color=3D#000000 face=3D"Times New =
Roman"=20
size=3D2>them in my object_t</FONT></EM></STRONG></DIV>
<DIV><STRONG><EM><FONT color=3D#000000 face=3D"Times New Roman" =
size=3D2>structure.=20
I'd also appreciate any help in how I'm supposed to assign=20
</FONT></EM></STRONG><STRONG><EM><FONT color=3D#000000 face=3D"Times New =
Roman"=20
size=3D2>functions to the pointers,</FONT></EM></STRONG></DIV>
<DIV><STRONG><EM><FONT color=3D#000000 face=3D"Times New Roman" =
size=3D2>and how to=20
call those functions.</FONT></EM></STRONG></DIV>
<DIV><STRONG><EM><FONT color=3D#000000 face=3D"Times New Roman"=20
size=3D2></FONT></EM></STRONG> </DIV>
<DIV><STRONG><EM><FONT face=3D"Times New Roman"=20
size=3D2>Thanks!</FONT></EM></STRONG></DIV>
<DIV><STRONG><EM><FONT face=3D"Times New Roman"=20
size=3D2></FONT></EM></STRONG> </DIV>
<DIV> </DIV>
<DIV><STRONG><EM><FONT color=3D#000000 face=3D"Times New Roman"=20
size=3D2>-+-+-+-+<STRONG><EM><FONT color=3D#000000 face=3D"Times New =
Roman"=20
size=3D2>-+-+-+-+<STRONG><EM><FONT color=3D#000000 face=3D"Times New =
Roman"=20
size=3D2>-+-+-+-+<STRONG><EM><FONT color=3D#000000 face=3D"Times New =
Roman"=20
size=3D2>-+-+-+-+<STRONG><EM><FONT color=3D#000000 face=3D"Times New =
Roman"=20
size=3D2>-+-+-+-+-</FONT></EM></STRONG></FONT></EM></STRONG></FONT></EM><=
/STRONG></FONT></EM></STRONG></FONT></EM></STRONG></DIV>
<DIV><STRONG><EM><FONT face=3D"Times New Roman"=20
size=3D2>         Please reply =
to News=20
Group</FONT></EM></STRONG></DIV>
<DIV><STRONG><EM><FONT face=3D"Times New Roman" =
size=3D2></FONT></EM></STRONG>
<DIV><STRONG><EM><FONT color=3D#000000 face=3D"Times New Roman"=20
size=3D2>-+-+-+-+<STRONG><EM><FONT color=3D#000000 face=3D"Times New =
Roman"=20
size=3D2>-+-+-+-+<STRONG><EM><FONT color=3D#000000 face=3D"Times New =
Roman"=20
size=3D2>-+-+-+-+<STRONG><EM><FONT color=3D#000000 face=3D"Times New =
Roman"=20
size=3D2>-+-+-+-+<STRONG><EM><FONT color=3D#000000 face=3D"Times New =
Roman"=20
size=3D2>-+-+-+-+-</FONT></EM></STRONG></FONT></EM></STRONG></FONT></EM><=
/STRONG></FONT></EM></STRONG></FONT></EM></STRONG></DIV></DIV>
<DIV><STRONG><EM><FONT color=3D#000000 face=3D"Times New Roman"=20
size=3D2></FONT></EM></STRONG> </DIV>
<DIV><STRONG><EM><FONT color=3D#000000 face=3D"Times New Roman"=20
size=3D2></FONT></EM></STRONG> </DIV>
<DIV><STRONG><EM><FONT color=3D#000000 face=3D"Times New Roman"=20
size=3D2></FONT></EM></STRONG> </DIV></BODY></HTML>
------=_NextPart_000_0058_01BE628D.7706D5C0--
- Raw text -