K&R-style variadic functions

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Jul 17 11:39:25 PDT 2012


On Tue, Jul 17, 2012 at 08:07:08PM +0200, Paulo Pinto wrote:
> On Tuesday, 17 July 2012 at 15:16:56 UTC, Regan Heath wrote:
[...]
> >So all K&R function declarations were <name>() with no parameters.
> >
> >R
> 
> K&R was more than that.

This modern C declaration:

	int main(int argc, char **argv) {
		exit(1);
	}

is written thus in K&R:

	int main(argc, argv)
		int argc;
		char **argv;
	{
		exit(1);
	}


> I guess most old timers here will agree with me that it was
> not much more than glorified assembler in what concerns typing.
[...]

I guess you predate me. ;-) When I started learning C, it was already in
the ANSI syntax, though there were enough K&R style code floating around
that I've at least _seen_ K&R syntax. I'm guessing nowadays most people
don't even know what K&R syntax is.


T

-- 
If I were two-faced, would I be wearing this one? -- Abraham Lincoln


More information about the Digitalmars-d mailing list