delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/12/13/12:37:51

From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Help! function typedef
Date: 13 Dec 2000 17:24:51 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 27
Message-ID: <918bd3$id6$1@nets3.rz.RWTH-Aachen.DE>
References: <3a30b1a8$0$24264 AT diablo DOT uninet DOT ee> <006101c06103$dc9dd020$aa4d57cb AT spunky> <3a34d45e$0$24309 AT diablo DOT uninet DOT ee> <01c06396$d935cd80$b8247d81 AT doug> <83n1e2963c DOT fsf AT mercury DOT st DOT hmc DOT edu> <913sfo$fil$1 AT bob DOT news DOT rcn DOT net> <3a376c34$0$24311 AT diablo DOT uninet DOT ee>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 976728291 18854 137.226.32.75 (13 Dec 2000 17:24:51 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 13 Dec 2000 17:24:51 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Tonu Aas <tonu AT ids DOT ee> wrote:
>> The valid C he might be thinking of is as follows:
>>
>>     typedef int MY_FUNC_TYPE(void);
>>     MY_FUNC_TYPE func;
> O.k., thats better than my example.

>> Actually declaring functions in this manner is less useful, because you
>> can *only* declare (and prototype) a function with the above; you can't
>> define one.

Note this explicitly speaks of *functions* as the subject of typedefs.

>     My logic says that if so, then we can ONLY declare :
> typedef int my_type;

> And after I cant define any actual variable ?
> my_type instance;     ???

Your logic is wrong. You're extending what's said to regimes where it
doesn't apply. Of course you can typedef object types (pointers, or
simple types, no matter) and use them to define variables.


-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019