Variable declaration between function name and first curly brace

It's the old style function definition

void foo(a,b)
int a;
float b;
{
// body
}

is same as

void foo(int a, float b)
{
// body
}

Your case is same as int main(int c,char *v){...} But it's not correct.

The correct syntax is : int main(int c, char **v){...}

Or, int main(int c, char *v[]){...}

EDIT : Remember in main() , v should be char** not the char* as you have written.

I think it's K & R C style.


It is a pre-ANSI C syntax for function declaration. We don't use it anymore. It is the same as:

int main(int c, char *v)

Tags:

C

Obfuscation