Follow us on facebook

Tuesday 16 April 2013

Difference between macro and subroutine:

Difference between macro and subroutine:
1.a macro call is an instruction to replace the macro name with its body, whereas subroutine call is an instruction to transfer the program’s control to the subroutine’s definition with all paraneters, if required.
2. A macro call results in macro expansion, whereas subroutine call results in execution.
3. Macro expansion increases the size of the program but subroutine execution doesn’t affect the size of the program
4. Macro expansion doesn’t affect the execution speed of the program much in comparison to subroutines affect the execution speed of the program

3 comments: