Y
Yoni Rabkin Katzenell
Hello,
The following useless code seems to compile and run, but I'm not sure
why. I turned on all the compiler warning flags, but it remains silent.
[Start code]
1 #include <stdlib.h>
2 #include <stdio.h>
3
4 int main (argc, argv)
5 int argc; char *argv[];
6 {
7 (void) printf("%d\n", argc);
8 return(EXIT_SUCCESS);
9 }
[End code]
My question is concerning the style of declaring the argument types
between the function and the block of code as in line 5. This as opposed
to what I'm used to seeing:
....some-code...
int main (int argc, char *argv[])
{
....more-code...
What style is that? Is it standard C?
Of course I'm not asking specifically about 'argc' and 'argv', but about
that form of declaration for a function's arguments.
Thank you in advance.
The following useless code seems to compile and run, but I'm not sure
why. I turned on all the compiler warning flags, but it remains silent.
[Start code]
1 #include <stdlib.h>
2 #include <stdio.h>
3
4 int main (argc, argv)
5 int argc; char *argv[];
6 {
7 (void) printf("%d\n", argc);
8 return(EXIT_SUCCESS);
9 }
[End code]
My question is concerning the style of declaring the argument types
between the function and the block of code as in line 5. This as opposed
to what I'm used to seeing:
....some-code...
int main (int argc, char *argv[])
{
....more-code...
What style is that? Is it standard C?
Of course I'm not asking specifically about 'argc' and 'argv', but about
that form of declaration for a function's arguments.
Thank you in advance.