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 will happend if i fire this command in linux " rm -r / "

1804


plz plz help me "how can i face dell varcent round"....? plzzzzzzzz help me friends.....?

1990


100 computers ip how to calculate

2386


what is recursion in c language?

1967


How to freely move a ball in graphics mode.

2420


Why do you want to work here

1747


T is a tree and V is a vertex of T of maximum degree in T, say the degree of V in n. Prove that T has atleast n vertices of degree 1.

1887


how to delete four out of five duplicate records in a table using sql

1989


A short CI column of hollow circular section has projecting bracket carrying a load of 10 tonnes. The load line is off the column by 20cm. The external diameter of the column is 350mm and thickness of metal is 25 mm. Find the maximum stress intensity in the section.

3676


HI i have 2 year manual testing exp from MNC in pune but due to some reason i am looking job in testing . Friends hepl me to get the job i am not getting calls. alim24@gmail.com.09860643281

2400


tell me one scenario where we go for idoc and WHy we go for idoc.

2229


sir, please send me the last three years exam papers conducted by CPCL- RECRUITMENT EXAM FOR Recruitment of Engineer ELECTRICAL ENGINEERING. A Soon as possible. i would be greatfull to u

1866


how is the config take place and from reciever side how will process the data into internal table

1781


how to cable size by Amp with example

2645


A polynomials in mamory can be represented by____________

2102