Question: I found the following declaration code in the [very early sources of C compiler](https://github.com/mortdeus/legacy-cc/blob/master/last1120c/c00.c)

```
main(argc, argv)
int argv[]; { 
   return 0;
}

```

I tried to run it on ideone.com compiling it in "C" mode with gcc-4.7.2 and it compiles fine and even runs successfully

```
result: Success     time: 0s    memory: 1828 kB     returned value: 0

```

Now I'm aware that there was a pre-standard way of declaring function parameters this way:

```
int funct(crc, buf, len)
    int crc;
    register char* buf;
    int len;
{
   //function implementation
}

```

but in the latter style it's quite clear - the parameters are first just listed, then declared as if they were a kind of local variables and I see all the parameters declared and the return type.

Back to the first code

```
main(argc, argv)
int argv[]; { 
   return 0;
}

```

in the former code there're two parameters listed and only one declared and it looks like `argv` has type `array of int`.

How is it being treated by the compiler?

Answer: 
You are talking about pre-ANSI C, and the style of prototype known as K&R prototypes. For such function declarations, parameters and return values whose types are not specified are deemed to be of type `int`.
```
main(argc, argv)
int argv[]; { 
   return 0;
}

```

1. The type of `argc` is `int` in K&R C and C90 due to the implicit integer conversion rule but it's not a conforming code in C99 & C11. Because the implicit int conversion has been deprecated in C99 and C11. Same goes for the return value of main().
2. main() receives the arguments passed from the host. Since main() can't receive array of `ints` but only an array of strings. This could potentially cause undefined behaviour because the actual arguments passed to main() can't be accessed with using an integer array. Compiler can't do type checking for the parameters because main() is called from outside (from the hosted environment). So compiler assumes whatever you say as parameters for main() are correct. You can even do:

> 
> 
> ```
> int main(argc, argv, a, b,c)
> int argc;
> int argv[];
> int a, b, c;
> {
> ....
> }
> 
> ```
> 
> 

This is a valid code. But there's no legal way to access all these `int`s (except argc).