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

What is algorithm in c++ programming?

1126


Why is c++ awesome?

1033


What is the difference between global int and static int declaration?

1065


Do you know what are pure virtual functions?

1150


Explain the purpose of the keyword volatile.

1171


What is the use of pointer in c++ with example?

1048


What is the main purpose of c++?

1065


Is java the same as c++?

991


Write an algorithm that determines whether or not an almost complete binary tree is a heap.

3920


How are pointers type-cast?

1117


Why do we need templates?

990


Is c++ an integer?

1037


What does I ++ mean in c++?

1107


Explain what are single and multiple inheritances in c++?

1027


Explain Memory Allocation in C/C++ ?

1071