next up previous contents index
Next: Raw output Up: C++ Basics Previous: Variables and Functions   Contents   Index

Program Execution

All the ``action'' in a C++ program occurs inside the special function main. Running a compiled C++ program is viewed by the operating system as calling the program's main function. The return value (an int) is the program's exit status. In an ePiX file, the main action usually consists of setting the logical and printed size of the figure, then building and drawing the figure, changing attributes when desired. ePiX output proper starts with begin() and terminates with end(). The intervening statements constitute the body of the figure.

In C++, a function may not be defined inside another function. Thus, variables may be defined inside main, but functions cannot be.



Andrew D. Hwang 2004-09-04