Defining symbols in C and C++

The #define symbol is a constant and macro that the preprocessor expands before compilation. No storage is allocated for these symbols. They have no type, and the debugger cannot reference them.

About this task

This definition has the same effect as the following preprocessing switch:

   /D<name>{=|#}<text>

To define symbols:

Procedure

  1. On the Add Preprocessing Symbol window, select the Add Symbol and Defined radio buttons.
  2. In the Symbol field, type the name of the symbol and the value, if it has one, using the following format:
       <symbol> = <value>

    For example, to define a preprocessing symbol ev_H with the value
    "$Id: event.h 1.22 1999/02/03 11:12:36 amy Exp $", type:

    ev_H = "$Id: event.h 1.22 1999/02/03 11:12:36 amy Exp $"
  3. Depending on what you want to do:
    • Click Apply if you want to enter another #define symbol.
    • Click OK if you are done and to return to the Preprocessing tab. Notice that a symbol with type D is added to the list of preprocessing symbols.
  4. Click OK.

Feedback