From: "Ned Konz" <[EMAIL PROTECTED]>
> I don't think you can drop the argument names in the definition of a C
> subroutine. You can in C++, though. Or in the declaration of a
subroutine.
> But aren't we talking about a definition here?
Yes. Declarations needs type information only. Definitions need
variable names only (types default to ever-popular int -- if you are on
an IP platform [sizeof(int) == sizeof(void*)], this means you can pass
pointers in as well :-).
This is bad practise, but quite legal. GCC just compiled this for me:
foo(a,b) { return a+ b; }
int main () { return foo(1, 2); }
$ gcc -o x x.c
$ ./x
$ echo $?
3
Cheers,
--binkley
- Patch to Inline::C to wrap declarations Ariel Scolnicov
- Re: Patch to Inline::C to wrap declarations B. K. Oxley \(binkley\)
- Re: Patch to Inline::C to wrap declarations Ned Konz
- Re: Patch to Inline::C to wrap declarations B. K. Oxley \(binkley\)
- Re: Patch to Inline::C to wrap declarations Brian Ingerson
- Re: Patch to Inline::C to wrap declarations Ariel Scolnicov
- Re: Patch to Inline::C to wrap declarations Ariel Scolnicov
- Re: Patch to Inline::C to wrap declarations Brian Ingerson
- Re: Patch to Inline::C to wrap declarations B. K. Oxley \(binkley\)
- Re: Patch to Inline::C to wrap declarations B. K. Oxley \(binkley\)
- Re: Patch to Inline::C to wrap declarations Neil Watkiss
- Re: Patch to Inline::C to wrap declarations Neil Watkiss
