Programming and Graphics

(Kiana) #1

44 Introduction to C++ Programming and Graphics


Postscript is a computer language like C++. A postscript printer un-
derstands this language and translates it into pen calls that draw images and
high-quality fonts.


Software distributions


Suppose that a project namedrizogaloand another project namedtra-
hanasare defined in the makefile. To execute both, we define in the same
makefile the task:


all:
rizogalo
trahanas

and issue the command:


make all

The tasksinstallandclean, defining software installation and distilla-
tion procedures, are common in makefiles accompanying software distributions.
To install software, we type


make install

To remove unneeded object files, we type


make clean

Problems


2.7.1.Define in a makefile a project calledcleanthat removes all.oobject files
from the current directory using the Unixrmcommand (see Appendix A.)


2.7.2.Define in a makefile a project that generates the executable of a C++
program and then runs the executable.


2.8 Simplecodes


We are in a position to write, compile, and execute a simple C++ code.


The following program declares, evaluates, and prints an integer:

#include <iostream>
using namespace std;
Free download pdf