The extension “.cpp”. Although .C and .cc are sometimes used on UNIX / Linux.
12. What type of program is used to create “source code.”
A text editor. Note: many Microsoft Windows compilers supply an Integrated
Development Environment (IDE) that contains a text editor (among other things). In spite
of all the wrapping, however, it’s still a text editor.
13. What is the extension for object files on our machine?
DOS/Windows uses “.OBJ”. UNIX uses “.o”.
14. What type of programs are used to produce object files?
Compilers.
15. What is the extension for the executable programs?
DOS/Windows uses “.EXE”. UNIX uses no extension.
16. What type of files go into creating an executable program?
Programs start out as “source.” They get translated into “object” files by the compiler.
These are combined with “libraries” by the linker into an “executable program.”
17. What type of program is used to create an executable program?
The compiler starts the process, but it produces object files. The linker is the program that
actually produces the executable programs. Note: the actual linking step may be hidden
since the UNIX CC wrapper and the DOS Inte grated Development Environments run the
linker behind your back.
18. How do you access the on-line help system for your compiler?
Most DOS/Windows Integrated Development Environments have a built-in help system.
On UNIX you can use the “man” command.
Page 6
Chapter 3: Style
There is no programming language, no matter how structured, that will prevent programmers from
writing bad programs.
- L. Flon
It is the nobility of their style which will make our writers of 1840 unreadable forty years from now.
- Stendhal
Teacher’s Notes
As a professional programmer I have had to maintain a lot of code. Most of it in very poor condition.
Hopefully, by teaching commenting and style early we can convince future programmers to write well
commented, easy to read programs.
In this chapter we describe how to comment programs. It may seem strange to learn how to comment
before we know how to program, but the comments are the most important part of the program.
That last statement deserves repeating, Comments are the most important part of the program. I grade
homework 60% on comments and 40% on code.
At this point it may seem that I’m somewhat of a fanatic on commenting. I am. You get this way after
spending years going through uncommented code while trying to maintain it.
Practical C++ Programming by manish baranwal
Start from the beginning
