- #1
fog37
- 1,568
- 108
Hello Forum,
I am new to C programming and I have a few questions about the main() function.
The main function does not take any arguments (nothing written between the round parentheses): main() or even main(void) . I have also seen the expression void main. Is that the same as main(void)?
Every function, main included, must have a return statement at the end. For the main function, the return=0. What does that mean? Why 0? My understanding of the return statement is that it reports the output value of the function. If a function job is to calculate the sum of two integers, i.e. sum = a+b, then return = sum
Thanks,
fog37
I am new to C programming and I have a few questions about the main() function.
The main function does not take any arguments (nothing written between the round parentheses): main() or even main(void) . I have also seen the expression void main. Is that the same as main(void)?
Every function, main included, must have a return statement at the end. For the main function, the return=0. What does that mean? Why 0? My understanding of the return statement is that it reports the output value of the function. If a function job is to calculate the sum of two integers, i.e. sum = a+b, then return = sum
Thanks,
fog37