Installation instructions for the library for "Computing
Concepts with C++ Essentials"

1. Installing Files

There are two methods for installation, no-brain and professional. I recommend
you start with no-brain if you use the library for yourself.

(A) No-brain

Copy all files from this directory (cccfiles) to your homework directory.

(B) Professional

Make a directory (say c:\ccc2book) on your hard disk. Copy all files from this
directory to a c:\ccc2book\cccfiles subdirectory. Add c:\ccc2book\cccfiles
to the INCLUDE path of your compiler. (Instructions for this vary;
check http://www.horstmann.com/ccc.html for directions for several popular
compilers.)

2. Compiling programs

The library auto-senses many versions of the Borland, Microsoft, Symantec
and g++ compilers.

In 16-bit, all programs must be compiled with LARGE MEMORY MODEL.

(A) Console programs under DOS/Unix

Just compile and run.

(B) ASCII graphics programs under DOS/Unix

Replace #include "ccc_win.cpp" with #include "ccc_asc.cpp", then compile
and run

(C) Graphics programs under DOS

Compile with the graphics library and run. The EGAVGA.BGI file from Borland
must be in the CURRENT directory. (Copy it from \BC\BGI.) Hit any key
after the program has finished to return to DOS.

(D) Console programs under Windows

Make sure to compile them as "Console" or "EasyWin" programs.

(E) Graphics programs under Windows

You must build a project and compile as "Windows application". Instructions
for building a project vary widely

(F) Graphics programs under Unix

Remember to link with the X11 libraries. For example,
   g++ myprog.cpp -lX11 -L/usr/X11R6/lib
The location of the libraries varies among systems.

3. Using the CCC libraries with multiple modules

If you need to use the CCC ANSI compatibility library or the CCC window
library with multiple modules, follow this simple rule:

  #include "ccc_ansi.cpp" or #include "ccc_win.cpp" in the file that contains
  the main function.

  #include "ccc_ansi.h" or #include "ccc_win.h" in all other files

4. Eliminating the CCC compatibility library

All sample console programs start out with the weird incantation

   #include "ccc_ansi.cpp"
   #ifndef CCC_ANSI_H

#include <iostream>
/* more #include directives */

using namespace std;

   #endif

If your compiler is fully ANSI compatible, you can remove the lines

   #include "ccc_ansi.cpp"
   #ifndef CCC_ANSI_H

and

   #endif

leaving only

#include <iostream>
/* more #include directives */

using namespace std;


Then your compiler's ANSI library is used instead of the CCC ANSI emulation
library.

Fair warning: Most compilers deviate from the ANSI standard to some degree,
and you should expect to make some modifications to some of the programs
to work around the limitations of your compiler. Complain to your compiler
vendor and let them know that ANSI compatibility is important to you.


