+1 vote
130 views
in C program by (3.4k points)
edited

What is a main() and difference b/w void main() and int main()?

1 Answer

0 votes
by (3.4k points)
selected by
 
Best answer
main() is an entry point ( main function) which is in most programming languages, When compiler begins compile the program, It looks for an entry point, and main() acts as an entry point in C program, or we can say main is a thread/ process/ function that invokes automatically by the compiler when program is being executed.

Every function returns a value to the calling function, at that time main will be a called function for compiler/OS and it will return some value to the compiler before exit, here void and int defines that main will return a void ( nothing) and int will return an integer values to the compiler.

Related questions

+1 vote
1 answer 113 views
0 votes
1 answer 120 views
+1 vote
1 answer 155 views
0 votes
1 answer 146 views
asked Oct 1, 2022 in Tailwind by Doubtly (98.9k points)
0 votes
1 answer 133 views

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

561 users

...