[comp.lang.c] How do I define ....

cml@tove.umd.edu (Christopher Lott) (03/08/90)

In article <1990Mar7.212639.10313@dinorah.wustl.edu> art@dinorah.wustl.edu (Arthur B. Smith) writes:
>    The simplest question is "Can you define a function of no
>arguments that returns a pointer to a function returning int?"
>
>    The next question is "How?"


I didn't know the answer, but I did know how to get the answer. 
A program called "cdecl" comes in very handy at these times.
In the following script, I typed the first line, it answered with the second.

Script started on Thu Mar  8 10:00:06 1990

tove:/u/cml(1)% cdecl
declare foo as function returning pointer to function returning int
int (*foo())()
^D
tove:/u/cml(2)% exit

script done on Thu Mar  8 10:00:36 1990

The cdecl program is available from host mimsy.umd.edu (128.8.128.8) via
anonymous ftp in file "cdecl.shar"  (or I could mail it to a desperate UUCP
site :-).  You must have lex & yacc to compile it.

chris...
--
cml@tove.umd.edu    Computer Science Dept, U. Maryland at College Park
		    4122 A.V.W.  301-454-8711	<standard disclaimers>