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

Plz reply on [email protected], You are to implement a code cracking ...

You are to implement a code cracking system. The system will deploy four processes (p1,p2,p3 & p4) to try to guess the password of an encrypted code. For encryption, we consider th

C program to create, Aim: To implement a program to create, update & displ...

Aim: To implement a program to create, update & display account & admin record of person using display account & admin records of person using virtual base class.. Code:

C program for function of find the factorial , C Program for FUNCTION OF FI...

C Program for FUNCTION OF FIND THE FACTORIAL float factorial(float); void main() {           float i=0,c=0;           clrscr();           printf("ENTER THE DIGI

What if one can''t wrap the local in an artificial block?, What if one can'...

What if one can''t wrap the local in an artificial block?

What is threaded binary tree, Threaded binary tree: Consider the linked il...

Threaded binary tree: Consider the linked illustration of a binary tree 'T.  Approximately half of the entries is the pointer fields 'LEFT' and 'RIGHT' will have null elements. Th

Write a structured and annotated c program, Intelligent homes are becoming ...

Intelligent homes are becoming increasingly popular as the cost/performance ratio of microcontrollers is continuously dropping.  These systems incorporate various transducers to de

Write a fragment of code that declares a variable, (a) Write a fragment of ...

(a) Write a fragment of code that declares a variable colSp of type ColourSpot, and then moves it to the point (3, -4), and sets its colour to Green. (b) A function QU8 is speci

Functions, what is the difference between call by reference and call by poi...

what is the difference between call by reference and call by pointer method?

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