Is there any standard rules when we write the main function. I always thought the main function should always be written as
int main(int argc, char* argv)
{
.....
return 1;
}
But to my surprise, all these definitions are also correct . I got a compile time warning. But no compiler error or run time error. I am using gcc compiler
char * main()
{
}
char * main(int, char)
{
}
char * main(char)
{
}
Can anyone shed some light over this ?