answersLogoWhite

0

The basic components are datatypes and functions. There must always be at least one function, the main function. This function implements the entry point of the application, and is typically used to process and act upon command-line arguments. Although you may write all your code within that one function, this is only suitable for trivial programs. More complex programs are best broken down into a series of smaller functions that can be called and re-called as required. For the most complex programs, functions and datatypes are best placed in separate files, grouped by purpose. This makes code easier to maintain but also makes code easier to re-use within other programs by modularising the component parts.

A source program -- or source code -- is the code that you, the programmer, write. The source code is usually written in a high level language but can also be written in a low level language, or even a combination of the two. The lower the level, the less abstraction there is between the source code and the resultant machine code. Although C is a high-level language, its flexibility allows programming at a procedural level, where the C instructions can be mapped very closely with the resultant machine code. Thus it is often classed a low level language. In reality it provides the best of both worlds, thus it is correctly termed a mid-level language. Since C++ inherits from C, it has similar properties. However C++ encourages the use of high-level object-oriented programming which makes it easier to produce and maintain more complex structured programs more easily than with C-style programming alone.

Object programs are the machine code files that are produced from your source code. Object programs should not be confused with "objects" as employed in the object-oriented programming paradigm (where an object is an instance of a class). In C, compiling your source code produces one or more object files which are subsequently linked to produce the final executable, the object program. By modularising your source code, compilation times can be greatly reduced since only those object files that are affected by modifications to the source code need be recompiled.

User Avatar

Wiki User

11y ago

What else can I help you with?