Concept
Where does execution begin in a C program?
ComputerScienceOne / The cmain() Function
"15.2.4. The main() Function Every executable program starts its execution somewhere. In C, the starting point is the main() function. When a program is compiled to an executable and the program is invoked, the code in the main() function starts executing. In our example, the code between the two curly brackets defines the main() function. At the end of the function we have a return statement. We’ll examine return statements in detail when we examine functions. The program is “returning” a zero value to the operating system. The convention in C is that zero indicates “no error occurred” while a non-zero value is used to indicate that “some” error occurred (the value used is determined by system standards such as the Portable Operating System Interface (POSIX) standard)."
Related Ideas
- How do you outline a C program that converts Fahrenheit to Celsius?ComputerScienceOne · Converting Units
- What role does the main() method play in a Java program?ComputerScienceOne · The javamain() Method
- How can a C program compute the roots of a quadratic equation?ComputerScienceOne · Computing Quadratic Roots
- How do functions work in programming languages?ComputerScienceOne · Functions
- What is the purpose of the main() method in a Java program?ComputerScienceOne · Comments
- What makes C a widely used programming language?ComputerScienceOne · Getting Started: Hello World
- What are the basic syntax rules of C?ComputerScienceOne · Basic Syntax Rules
- How are void functions defined in C?ComputerScienceOne · Void Functions