function declaration

Posted by robUK on Stack Overflow See other posts from Stack Overflow or by robUK
Published on 2010-04-23T10:10:01Z Indexed on 2010/04/23 10:13 UTC
Read the original article Hit count: 118

Filed under:

Hello,

gcc 4.1.2 c89

I am reviewing some code and I have come across the following function. I have never seen a function declared like this before.

There are no data types for the paraemeters.

My best guess is that the function is using a list of data types separated by semi-colons. The return type seems to be returning a function with those parameters. However, the read function is not defined anywhere.

What is the advantage and purpose of declaring a function like this?

Many thanks for any advice,

int my_read(fd, ptr, cnt)
   int fd;
   char *ptr;
   unsigned cnt;
{
   printf("Read\n");
   return(read(fd, ptr, cnt));
}

© Stack Overflow or respective owner

Related posts about c