I've been learning C programming in a self-taught fashion for some weeks, and there are some questions that I have concerning the main()
function.
All functions must be declared in their function prototype, and later on, in their defintion. Why don't we have to declare the main()
function in a prototype first?
Why do we have to use int main()
instead of void main()
?
What does return 0 exactly do in the main()
function? What would happen if I wrote a program ending the main()
function with return 1;
, for example?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…