explain the symbolic constants in c


Explain the Symbolic Constants in c language?

Symbolic constants are the constants of any type that declared by using the #define compiler directive and it is a preprocessor directive. The Preprocessor' is a translation phase that is applied to your source code before the compiler proper gets its hands on it. Usually the preprocessor performs textual substitutions on your source code. Macro is a kind of preprocessor which replaces instances of one piece of text with another.

The preprocessor line shown below defines symbolic constant

#define name text

Defines the macro with the given name having as its value the given replacement text. Subsequent to that (for the rest of the current source file) wherever the preprocessor sees that name it will replace it with the replacement text.

Its general syntax is as shown below

#define ANGLE_MIN 0
#define ANGLE_MAX 360

It would define ANGLE_MIN and ANGLE_MAX to the values 0 and 360 respectively and C distinguishes between uppercase and lowercase letters in variable names and it is customary to use capital letters in defining symbolic constants.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: explain the symbolic constants in c
Reference No:- TGS0304640

Expected delivery within 24 Hours