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...

difference between macro and function?

Answer Posted / soruabh

When you call a function your compiler enters a
call-sequence (which takes
time) and allocates a new stack frame for that function
(whcih takes text
stack space) so that the function's body can be executed.
After it's done
you enter a returning-sequence phase (which takes time).



A macro does not need anything of the above, because it's
preprocessor's job
to expand a macro, it's only about text replacement, not
about compiler
stuff or code-generating issues. So you don't expend time
and space doing
what a function would need in order to be executed.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe linked list using C++ with an example.

1122


How one would use switch in a program?

1115


Is c the same as c++?

1058


Will a catch statement catch a derived exception if it is looking for the base class?

1061


Is c++ double?

1096


What is class syntax c++?

1202


Difference between a homogeneous and a heterogeneous container

1199


Is empty stack c++?

1054


What do you mean by inheritance in c++? Explain its types.

1202


What is virtual base class?

1129


What is a c++ class?

1149


What is c++ stringstream?

1167


What are the two main components of c++?

1152


what is pre-processor in C++?

1215


which operator is used for performing an exponential operation a) > b) ^ c) none

1110