In C, what does it mean when a variable is declared between the function header and the body?

Possible duplicate:
C function syntax, parameter types declared after parameter list

Several times now I came across this code:

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

Why are argc and argv declared this way?

+6
source share
1 answer

This was the syntax used for the K & R * style parameter lists.

* K & R - Brian Kernigan and Dennis Ritchie, authors of the book, " Programming Language C. "
<"Dennis Ritchie" was also the creator of the C programming language and with Ken Thompson, the UNIX operating system.

+12
source

Source: https://habr.com/ru/post/914359/


All Articles