Bifalgorithm post · Computer science one · The cmain() Function

Where does execution begin in a C program?

Where does execution begin in a C program? (Computer science one · The cmain() Function) — "15.2.4. The main() Function Every executable program starts its exe…

Ideas in this flowchart

  • La función main() es el punto de inicio de un programa ejecutable en C.
  • Todo programa ejecutable comienza su ejecución en la función main().
  • Después de compilar e invocar el ejecutable, comienza el código de main().
  • En el ejemplo, el código entre las dos llaves define la función main().
  • Al final de la función aparece una sentencia return.
  • El programa devuelve un valor a la מערכת operativa.
  • Por convención, el valor cero indica que no ocurrió ningún error.
  • Un valor distinto de cero indica que ocurrió algún error.
  • El valor utilizado para indicar el error depende de estándares del sistema, como POSIX.
  • Las sentencias return se estudiarán en detalle al examinar las funciones.
Feed/

Where does execution begin in a C program?

No cover

Channel

Computer science one

1 page

"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)."

Flowchart preview
👍
0
0 comments0 shares

Sign in to view and post comments.