Go Back   Velocity Reviews > Newsgroups > C Programming
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply

C Programming - C function overloading?

 
Thread Tools Search this Thread
Old 05-31-2004, 12:48 AM   #1
JaSeong Ju
 
Posts: n/a
Default C function overloading?

I would like to overload a C function. Is there any easy way to do this?

  Reply With Quote
Old 05-31-2004, 01:13 AM   #2
E. Robert Tisdale
 
Posts: n/a
Default Re: C function overloading?

JaSeong Ju wrote:

> I would like to overload a C function.
> Is there any easy way to do this?


Just compile with a C++ compiler.
  Reply With Quote
Old 05-31-2004, 01:19 AM   #3
Martien Verbruggen
 
Posts: n/a
Default Re: C function overloading?

On Mon, 31 May 2004 09:48:23 +0900,
JaSeong Ju <> wrote:
>
>
> I would like to overload a C function. Is there any easy way to do this?


No.

Martien
--
|
Martien Verbruggen | Begin at the beginning and go on till you
| come to the end; then stop.
|

  Reply With Quote
Old 05-31-2004, 01:29 AM   #4
Ben Pfaff
 
Posts: n/a
Default Re: C function overloading?

JaSeong Ju <> writes:

> I would like to overload a C function. Is there any easy way to do this?


No. C does not support function overloading.
--
"When I have to rely on inadequacy, I prefer it to be my own."
--Richard Heathfield
  Reply With Quote
Old 05-31-2004, 01:43 AM   #5
Mabden
 
Posts: n/a
Default Re: C function overloading?

"Ben Pfaff" <> wrote in message
news:...
> JaSeong Ju <> writes:
>
> > I would like to overload a C function. Is there any easy way to do

this?
>
> No. C does not support function overloading.
> --
> "When I have to rely on inadequacy, I prefer it to be my own."


You could, however, write a wrapper function that calls the normal C
function, but adds new functionality. Many people do this in calling memory
functions, for instance.

--
Mabden



  Reply With Quote
Old 05-31-2004, 02:11 AM   #6
Ben Pfaff
 
Posts: n/a
Default Re: C function overloading?

"Mabden" <> writes:

> "Ben Pfaff" <> wrote in message
> news:...
>> JaSeong Ju <> writes:
>>
>> > I would like to overload a C function. Is there any easy way to do

> this?
>>
>> No. C does not support function overloading.

>
> You could, however, write a wrapper function that calls the normal C
> function, but adds new functionality. Many people do this in calling memory
> functions, for instance.


Do you know what function overloading is? It is not changing the
behavior of some particular function, i.e. as a wrapper would,
which seems to be your implication.
--
"I should killfile you where you stand, worthless human." --Kaz
  Reply With Quote
Old 05-31-2004, 04:14 AM   #7
jacob navia
 
Posts: n/a
Default Re: C function overloading?


"JaSeong Ju" <> a écrit dans le message de
news:c9dtcc$21r$...
> I would like to overload a C function. Is there any easy way to do this?


lcc-win32 is a compiler that supports function overloading.

http://www.cs.virginia.edu/~lcc-win32

It is not a C++ compiler


  Reply With Quote
Old 05-31-2004, 04:34 AM   #8
Ben Pfaff
 
Posts: n/a
Default Re: C function overloading?

"jacob navia" <> writes:

> "JaSeong Ju" <> a écrit dans le message de
> news:c9dtcc$21r$...
>> I would like to overload a C function. Is there any easy way to do this?

>
> lcc-win32 is a compiler that supports function overloading.
>
> It is not a C++ compiler


If it supports function overloading then it isn't a C compiler
either.
--
"IMO, Perl is an excellent language to break your teeth on"
--Micah Cowan
  Reply With Quote
Old 05-31-2004, 06:24 AM   #9
Mabden
 
Posts: n/a
Default Re: C function overloading?

"Ben Pfaff" <> wrote in message
news:...
> "Mabden" <> writes:
>
> > "Ben Pfaff" <> wrote in message
> > news:...
> >> JaSeong Ju <> writes:
> >>
> >> > I would like to overload a C function. Is there any easy way to do

> > this?
> >>
> >> No. C does not support function overloading.

> >
> > You could, however, write a wrapper function that calls the normal C
> > function, but adds new functionality. Many people do this in calling

memory
> > functions, for instance.

>
> Do you know what function overloading is?


What a nasty question. Of course I do. Do YOU know what a C forum is for?
Idiot.

--
Mabden


  Reply With Quote
Old 05-31-2004, 07:25 AM   #10
Stephen Sprunk
 
Posts: n/a
Default Re: C function overloading?

"JaSeong Ju" <> wrote in message
news:c9dtcc$21r$...
> I would like to overload a C function. Is there any easy way to do this?


Standard C does not allow true function overloading, such as in C++.

However, you may be able to simulate the effect with macros; examine
<tgmath.h> for ideas how. Note that the method used by <tgmath.h> is
necessarily implementation-dependent, so don't expect your code to be
portable.

S

--
Stephen Sprunk "Stupid people surround themselves with smart
CCIE #3723 people. Smart people surround themselves with
K5SSS smart people who disagree with them." --Aaron Sorkin

  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
equivalent function for itoa in Linux gcc compiler suse Software 0 03-06-2009 04:30 AM
How to assign a returns value of a javascript function to a hiddenfield in a webpart Chander Software 0 12-20-2007 08:14 AM
How to call C# function in javascript visj4u Software 2 04-23-2007 02:24 PM
MS Access not recognising Date() function tessythampan Software 0 08-28-2006 10:51 AM
I lost the "Help and Support" function from my start menu Keith A+ Certification 1 03-14-2005 02:05 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47