KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Many are familiar with the hello world program in C: #include <stdio.h> main () { printf ("hello world"); return 0; } Why do some precede the main() function with int as in: int main() Also, I've seen the word void entered inside the () as in: int main(void) It seems like extra typing for nothing, but maybe it's a best practice that pays dividends in other situations? Also, why precede main() with an int if you're returning a character string? If anything, one would expect: char main(void) I'm also foggy about why we return 0 at the end of the function.
Tags (comma-separated)
Save Edits
Cancel