Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what are macros?what are its advantages and disadvantages in
c language?

Answer Posted / ravi ranjan

A macro is a name given to a block of C statements as a
pre-processor directive. Being a pre-processor, the block of
code is communicated to the compiler before entering into
the actual coding (main () function). A macro is defined
with the preprocessor directive, #define.

Like::: #define A 10
#define SUM(x,y) ((x) + (y))

Advantages :::
1.Symbolic constants are evaluated by the PRE-processor,
i.e. they are re-written as literal values, not as
variables. this has some nice side-effects that you can do
using symbolic defines eg. macros and functions inside them.

run-time access to symbolic constants should be
significantly faster than access to variables.
opposite to that, variables (and constants) are evaluated by
the processor (compiler).

2. It is easy to modify the value of the constant
variable,since we have to change the value at the macro
defintion only

DisAdvantages:::

1. Macros are not useful when the function definitions are
Big and when the function is used many number of times.

Is This Answer Correct ?    52 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what do you mean by a p-code?

1981


Hi dost here Alok Kumar please send question pattern for NIC at godinall.kumar1@gmail.com or alok.iitb07@gmail.com

1830


what is 16kHz use in GSM

2014


in single linked list , each node contains data and address of next node. if middle of list the node is damaged/crashed then how to find where the link is failed and how to get the all the data which is stored after the crashed node?

2025


C++ PROGRAM FOR FIBONACCI SERIES USING COPY CONSTRUCTER

5245


compare the conditional operator with if-else-if statement.

1782


What is the meaning of int p(char*a);

1011


why this for loop doesn't work . int i; for(i=2;i=0;i--) { cout<

1837


there are 50 users in a network, one system is virus affected , how to find that virus affected system?

1807


Explain work?

974


draw the diagram of double earthing

1992


why there is a collision in switch

1866


can i get some win vista notes

1666


i want techical questions on c and java with code part

1822


hey,,,hi have taken an emergency date of 21st july...i was continuously checking for dates n i was not able to get a normal date n my school is starting from 8th of september...so plz tell me can i get a rejection based on this, that i have taken an emergency date?????

1715