pete wrote on 15/07/05 :
> Emmanuel Delahaye wrote:
>>
>> Kenneth wrote on 15/07/05 :
>>> void (*signal( int sig, void (*function)(int))) (int);
>>
>> This is a case where typedefs are useful
>>
>> typedef int signal_f (int);
>>
>> signal_f signal (int sig, signal_f * function);
>
> That gives my compiler an error:
> error C2091: function returns function
>
> This compiles OK:
> typedef int (*signal_f) (int);
> signal_f signal (int sig, signal_f * function);
No. The right code is:
typedef int (*signal_f) (int);
signal_f signal (int sig, signal_f function);
or
typedef int signal_f (int);
signal_f *signal (int sig, signal_f *function);
--
Emmanuel
The C-FAQ:
http://www.eskimo.com/~scs/C-faq/faq.html
The C-library:
http://www.dinkumware.com/refxc.html
..sig under repair