Explain the symbolic constants in c language, C/C++ Programming

Assignment Help:

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.


Related Discussions:- Explain the symbolic constants in c language

#coding, Smugglers are becoming very smart day by day. Now they have develo...

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

Area under curve, a program to find the area under curve y=f(x) between x=a...

a program to find the area under curve y=f(x) between x=a and x=b,integrate y=f(x) between the limits of a and b.   #include float start_point, /* G

201 it, overloadstream insertion opertator to display the data of object on...

overloadstream insertion opertator to display the data of object on the console

Explain the declaration of multi dimensional arrays, Explain the Declaratio...

Explain the Declaration of Multi Dimensional Arrays? In the figure, the range in the first dimension is 3 and in the second dimension is 4. The shaded portion corresponds to th

Define a function in c program, Define a function in c program: int f1...

Define a function in c program: int f1() { static int x=10; return x; } int f2() { int y=5; return y; } extern int z; void f()     {

Standard input- output using motorola and intel devices, Talking to IO boar...

Talking to IO boards inside a computer or microcontroller depends upon the principles used by the microprocessor to address physical devices. On Motorola systems all devices connec

Discuss polymorphism in c++, Problem 1. Discuss polymorphism in c++. ...

Problem 1. Discuss polymorphism in c++. Explaining Polymorphism 2. Write a program in c++ to read a 3X2 matrix and find smallest number in that matrix. Writin

Create a program of several prototypes for functions, In this assignment th...

In this assignment the main has been written for you in the file phone_book_main.cpp. You will also notice that a class called Person has been declared as having several prototypes

Mathematical statements, Mathematical Statements and assignments    Wi...

Mathematical Statements and assignments    Within C we can directly load up the variable from within the program using the mathematical expression equates (=) e.g.   a= 'h'

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd