df wrote:
what is base variable type is month? ;D
Lucky for him that the x86 uses a 32-bit value for both ints and pointers. On an Itanic or an UltraSPARC, it would be seriously hosed. The compiler should have warned about the bad cast from char* to int, and probably did (both VC++ 6.0 and gcc did when I tested it). Fortunately, literal strings are stored as globals, so there are no wild pointer problems, in this case. Had he read the string in with, say, scanf(), however, there would have hell to pay.
As for the original question, Tim-sensei has the right of it; main() is a special case, and can only take an int followed by a pointer to an array or char pointers as parameters (these are for accepting command-line arguments; the int is the number of arguments, while the arguments themselves are stored in the array of strings, with *argv[[0]] == the name of the program). Among other things, this is one of the reasons why Windows uses a function WinMain() at the start of Win32 API programs instead of just a main(); the main() function is there, IIRC, but because the entry point of a Windows program needs certain arguments and initializations, main() is automagically generated to handle the setup needed by WinMain().
BTW, you need to have a semicolon at the end of the struct declaration, are else it would look like it's part of the return type form main(). Adding an "[tt]#include <stdio.h>[/tt]" at the top would help, too. HTH. C&CW.