From: "Fernando Arturo G�mez Flores" 

>> Function overload is not present in C.  In C, either use 
>> different names
>> or pass a union of supported types (with additional identifier 
>> that give hints of the type to be used).
>>
>> HTH
>> Shyan
>>
>>
>
>Ah, I disagree. I think C supports function overload. 

No it doesn't.

>As an example, take
>the fcntl function in Linux API. That C-pure 

Linux API - 'C-pure' (what is this?) does not make it Standard C. 

>POSIX-standard 
>function, used for locking files, is declared as follows:
>
>#include <unistd.h>
>#include <fcntl.h>
>int fcntl(int fd, int cmd);
>int fcntl(int fd, int cmd, long arg);
>int fcntl(int fd, int cmd, struct flock* lock);

If this is how fcntl() is defined in your header files (as opposed to in 
comments in your header,) then your compiler should be complaining. If they are 
defined, and your compiler isn't complaining then your compiler is seriously 
broken.

>I think that is function overloaded. I'm I missing something?

fcntl() is varadic, and it (at runtime) determines what (if any) the third 
arguement is from the second argument. 
If that doesn't appear to make sense, think of printf() and how it might 
determine the 2nd, 3rd etc. parameters. (And no, there isn't a definition of 
printf with every permutation of parameters in stdio.h .)


--
PJH

Quantum materiae materietur marmota monax si marmota monax materiam possit 
materiari?



Alderley plc, Arnolds Field Estate, The Downs, Wickwar, Gloucestershire, GL12 
8JD, UK
Tel: +44(0)1454 294556 Fax: +44 (0)1454 299272

Website : www.alderley.com  Sales : [EMAIL PROTECTED] Service : [EMAIL 
PROTECTED]

This email and its contents are confidential and are solely for the use of the 
intended recipient. If you are not the original recipient you have received it 
in error and any use, dissemination, forwarding, printing or copying of this 
email is strictly prohibited. Should you receive this email in error please 
immediately notify [EMAIL PROTECTED]

This email has been scanned for viruses, however you should always scan emails 
with your own systems prior to opening.









------------------------ Yahoo! Groups Sponsor --------------------~--> 
$4.98 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/Q7_YsB/neXJAA/yQLSAA/EbFolB/TM
--------------------------------------------------------------------~-> 

To unsubscribe : [EMAIL PROTECTED]

 
Yahoo! Groups Links

<*> To reply to this message, go to:
    
http://groups.yahoo.com/group/Programmers-Town/post?act=reply&messageNum=4970
    Please do not reply to this message via email. More information here:
    http://help.yahoo.com/help/us/groups/messages/messages-23.html

<*> To visit your group on the web, go to:  
    http://groups.yahoo.com/group/Programmers-Town/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to