Skip to Content
Absolute Beginner's Guide to Programming, Third Edition
book

Absolute Beginner's Guide to Programming, Third Edition

by Greg Perry
November 2002
Beginner content levelBeginner
432 pages
11h 44m
English
Que
Content preview from Absolute Beginner's Guide to Programming, Third Edition

Using the main() Function's Format

The cornerstone of every C program is the main() function. Because main() is a function 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 procedure 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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Absolute Beginner's Guide to Programming, Second Edition

Absolute Beginner's Guide to Programming, Second Edition

Greg Perry

Publisher Resources

ISBN: 0789729059Purchase book