A Question About C 10-15-2015, 04:26 AM
#1
I am learning the C programming language, and have a question to ask experienced C programmers on this forum: Does putting "void" in a function declaration's parameter list have a difference between an empty parameter list?
Example:
Versus
Do these prototypes have any difference in any way at all? Also, I was reading on how the "main" function's return type could be "void". Is it true that the main function's return type can be void? If so, why, and is it different from the integer return type? Thank-you.
Example:
Code:
my_function(void);Versus
Code:
my_function();Do these prototypes have any difference in any way at all? Also, I was reading on how the "main" function's return type could be "void". Is it true that the main function's return type can be void? If so, why, and is it different from the integer return type? Thank-you.
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)