Using the main() Function's Format

The cornerstone of every C program is the main() function. Because main() is a func tion and not a command, the trailing parentheses are required. A C function, just like a Visual Basic procedure, is a section of code that does something. main() is required because execution of a C program always begins in its main() function. Programmers use main() to control the rest of the program. main() often includes a series of proce dure calls. (All procedures in C are known as function procedures ; you'll learn more about C functions in the section "C Functions," later in this chapter.)

The actual code for main(), as with all C functions you write, begins after the opening brace, {, and main() continues until the closing ...

Get Absolute Beginner's Guide to Programming, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.