O'Reilly logo

Just Enough C/C++ Programming by Guy W. Lecky-Thompson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Recap

A C program has a very distinct structure. It has an entry point, called the main function, and a collection of user-defined functions. All the code could be contained within the main function, but this would lead to a very unmanageable block of code.

Subsequently, you break up the code into functions, of which main is just one. Each function should perform a precise piece of processing and should be obvious from the function name.

You can also specify variables, which are places to store data of a specific type. These are declared either at the top of the source code, making them accessible to every statement in the source code (global variables), or they can be declared within the braces ({ }) that contain specific pieces of code (local ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required