According to ANSI specifications which is the correct way of declaring main() when it receives command line arguments?

A)

main(int argc, char *argv[])


B) main(argc,argv) int argc; char *argv[];
C) main() {int argc; char *argv[]; }
D) None of the above

Showing Answers 1 - 5 of 5 Answers

Richa Yadav

  • Jan 7th, 2006
 

a) main(int argc, char *argv[])

  Was this answer useful?  Yes

kbjarnason

  • Jul 1st, 2010
 

None of the above.  It should be:

int main( int argc, char *argv[] )

or

int main( int argc, char **argv )

Note that:

   a) these are different syntax for the same thing
   b) reliance on implicit-int is outmoded
   c) the names argc and argv are simply convention; most any names will do

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions