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

Why do you want to work here

1754


Tell me about your parents?? Pls share any one best words...

1716


What is meant by relay & co-ordination at substation engineering ?

2286


What will be the sql query to list the employee names those are getting 3rd highest salary ?

1808


can i get some win vista notes

1718


what is need of interface. what is the diff b/w interface and abstract class

1968


There are three bucket...Apple,Orange and Apple+Orange....On each Bucket one of the following labels are there..'A','O','A+O'...all this labels are not correctly patched on Bucket..identify which bucket contains What? You can not see bucket..u can pick any number of fruit from any basket...???

2681


Please send the details and fee for Intools training course..I would like to do the course in second week of jUNE 2010.

2195


My system suddenly get off,when i try to power on then it does not work but when i open it and clean RAM and insert it again, it power on.but after some day same problem? please give the answer (i have also changed RAM it's new.)

1912


what is the difference betweeen far pointer and near pointer

2281


I have applied for the post of Section Engineer. plz anyone send me the previous question paper. i did my engineering in Information Technology.

2015


can i knw what are we supposed to read for the coming oces/dgfs 2009 exam?what kind of book are we supposed to study?

2044


how to configure cisco router & switches plz provide me path steps?

2235


WHAT HAPPEN WHEN ANY SPINDLE RUN OVER 10 MM HEIGHT ABOVE BOLSTAR IN RING SPINNING FRAME

1841


How To Servers For Malitnationl Bank?

1818