Article View: comp.std.c
Article #4344Re: "Overloaded" function in C
From: Paul Long
Date: Wed, 08 Nov 1995 19:03
Date: Wed, 08 Nov 1995 19:03
27 lines
1382 bytes
1382 bytes
elemings@unix1.utm.edu (Eric Lemings) wrote:
>Take a look at the following program:
>
>#include <stdio.h>
>
>#define f(x, y) ((x) / (y))
>
>int (f)(int x, int y, int z)
> {
> return (x * y + z);
> }
[snip]
>Hunting season is now open. I tried this on a Standard C/Unix
>system compiler and it worked. Not sure how useful it is though.
I don't think it's useful at all. You have not overloaded "f".
In the general sense, there are still two names: "f" and "(f)".
This is no better than
int f1(int x, int y);
int f2(int x, int y, int z);
--
Paul Long 45:29:14N 122:48:09W
plong@perf.com http://www.teleport.com/~pciwww/
"Where time or intelligence are lacking, a goto may do the job."
- M.E. Hopkins, "A Case for the GOTO," 1972.
Technical Details
Message-ID:
<47quuo$tl@news0.rain.rg.net>Path:
arc1-ca.pugleaf.net!homer.alpha.net!pacifier!rainrgnews0!usenetReferences:
<47m4dl$eje@gaia.ns.utk.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!homer.alpha.net!pacifier!rainrgnews0!usenet From: Paul Long <plong@perf.com> Newsgroups: comp.std.c Subject: Re: "Overloaded" function in C Date: 8 Nov 1995 19:03:52 GMT Organization: Performance Computing Incorporated Message-ID: <47quuo$tl@news0.rain.rg.net> References: <47m4dl$eje@gaia.ns.utk.edu> NNTP-Posting-Host: yosemite.perf.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 1.1N (X11; I; SunOS 4.1.1 sun4c) X-URL: news:47m4dl$eje@gaia.ns.utk.edu