prev up next   top/contents search

comp.lang.c FAQ list · Question 11.12a

Q: What's the correct declaration of main()?


A: There are two valid declarations:

	int main(void)
	int main(int argc, char **argv)
although they can be written in a variety of ways. The second parameter may be declared char *argv[] (see question 6.4), you can use any names for the two parameters, and you can use old-style syntax:
	int main()

	int main(argc, argv)
	int argc; char **argv;

See also questions 11.12b to 11.15.

References: ISO Sec. 5.1.2.2.1, Sec. G.5.1
H&S Sec. 20.1 p. 416
CT&P Sec. 3.10 pp. 50-51


prev up next   contents search
about this FAQ list   about eskimo   search   feedback   copyright

Hosted by Eskimo North