Category : C Source Code
Archive   : SHERLOCK.ZIP
Filename : CPP.DOC

Output of file : CPP.DOC contained in archive : SHERLOCK.ZIP
CPP Version 5.3: August 4, 1989.


This file briefly describes CPP, a Preprocessor Program for the C language.

For an introduction to C and the C preprocessor, see K&R, i.e., the book,
The C Programming Language, second edition, by Kernighan and Ritchie, published
by Prentice Hall.

As far as is known, CPP meets all specifications in the Draft C
Standard of January, 1988. Please report all bugs to:

Edward K. Ream
1617 Monroe Street
Madison, WI 53711
(608) 257-0802.


CPP copies an input file to an output file, doing the following as it does so:

o It includes files into the output file. Included files may include other
include files to any depth.
o It expands macros. Macros may have arguments and may call other macros.
The details of macro processing are EXTREMELY complicated. See the Draft C
Standard of January, 1988 for full details.
o It conditionally includes lines from the input files. These directives may
be nested to any depth.
o It eliminates all comments by default, though comments may be included in
the output file if desired.


CPP supports the following preprocessing directives. See K&R or the Draft C
standard for a description of what these directives do.

#define identifier replacement_text
#define identifier(argument_list) replacement_text
#if constant_expression
#ifdef identifier
#ifndef identifier
#include "filename"
#include tokens
#line line_number [optional_file_name]
#undef identifier


Invoke CPP as follows:

CPP input_file output_file [optional_arguments]

The following arguments are optional:


Include comments and extra white space in the output file. By default,
comments and extra white space are excluded from the output file.

-d identifier
-d identifier=definition

Define an identifier on the command line, just as if

#define identifier definition

appeared at the start of the input file. The equal sign is not part of the
definition of the identifier. If the equal sign and definition are omitted, an
empty definition is created.

Whitespace is required between the -d and the identifier.


Allow nested comments. By default, CPP follows the C standard and disallows
constructions such as

/* comment out -----
a = 5;
/* This is a nested comment. */
----- end comment out */

-s path

Specify one or more "standard places" to search when looking for included
files. For example:

CPP in out -s \src -s d:\src\headers

If no -s option is specifed, CPP uses \usr\include.

Whitespace is required between the -s and the path.

-u identifier

Cancel the first definition of identifier, as if #undef identifier were
inserted immediately following the that definition.

  3 Responses to “Category : C Source Code
Archive   : SHERLOCK.ZIP
Filename : CPP.DOC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: