What are the advantages of Macro over function?

Answer Posted / hrpynux@gmail.com

When writing macros for functions, they saves a lot of time that is spent by the compiler for invoking / calling the functions. Hence, The advantage of a macro over an actual function, is speed. No time is taken up in passing control to a new function, because control never leaves the home function.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the types of operators in c?

615


What is register variable in c language?

609


Difference between pass by reference and pass by value?

660


which is conditional construct a) if statement b) switch statement c) while/for d) goto

741


What is an endless loop?

806






a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list

634


Can you write the function prototype, definition and mention the other requirements.

664


What is the difference between procedural and declarative language?

657


How do c compilers work?

613


Should I learn c before c++?

624


What are near, far and huge pointers?

650


Explain how are 16- and 32-bit numbers stored?

787


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

761


Why do we use & in c?

595


Where register variables are stored in c?

554