tags:

views:

253

answers:

2

In some library I'm using (written in C) its

StorePGM(image, width, height, filename)
char *image;
int width, height;
char *filename;
{
  // something something
}

All functions are defined this way. I never seen such function definitions in my life. They seem to be valid to MSVC but when I compile it as C++ it gives errors.

What is it? some kind of old version C?

+14  A: 

Yes. K&R, pre-standard C. Avoid using it.

Alex
Yes, and they also suggest not using it in new project since the third edition of the book.
tunnuz
@tunnuz, The *third* edition? Third edition of what?
Alex
QuantumPete
@QuantumPete, since when is there a third edition?
Alex
I was wrong! It is the second edition :) Sorry.
tunnuz
From back in the goo old days, when the entire language could be adequately explained in about 100 pages (a least in the first edition).
KeithB
A: 

Yep, it's K&R-Style. (Kernigham & Ritchie are the inventors of C) See also http://www.lysator.liu.se/c/bwk-tutor.html for examples of this pre-ANSI style.

MartinStettner
Kernighan had nothing to do with the invention of C.
anon
Wasn't aware of that fact, thanks. Anyway he co-authored the first book on C...
MartinStettner