Re: More function names, same implementation
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Fri, 06 Nov 2009 18:44:54 -0800
InuY4sha <inuy4sha@xxxxxxxxx> writes:
I need - if exists - the correct syntax to do something like this:
int foo1(void *)
int foo2(void *)
{
return 0;
}
Is there a way besides #defining?
Just to be clear, you want foo1 and foo2 to be two different names for
the same function, right?
In your example, ignoring the first line, you have a definition for
foo2 with no name for the parameter, which means the parameter can't
be used. I'll assume you left the name out for the sake of the
example.
int foo1(void *param)
{
return 0;
}
int (*const foo2)(void*) = foo1;
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
.
- Follow-Ups:
- Re: More function names, same implementation
- From: InuY4sha
- Re: More function names, same implementation
- References:
- More function names, same implementation
- From: InuY4sha
- More function names, same implementation
- Prev by Date: Re: How to convert Infix notation to postfix notation
- Next by Date: Re: usage example for container_of in functions
- Previous by thread: More function names, same implementation
- Next by thread: Re: More function names, same implementation
- Index(es):
Relevant Pages
|