Difference between macros and functions in C in relation to instruction memory and speed

Posted by DAHANS on Stack Overflow See other posts from Stack Overflow or by DAHANS
Published on 2014-05-27T21:16:13Z Indexed on 2014/05/27 21:26 UTC
Read the original article Hit count: 152

Filed under:
|
|
|

To my understanding the difference between a macro and a function is, that a macro-call will be replaced by the instruction in the definition, and a function does the whole push, branch and pop -thing. Is this right, or have I understand something wrong?

Additionally, if this is right, it would mean, that macros would take more space, but would be faster (because of the lack of the push,branch and pop instructions.), wouldn't it?

© Stack Overflow or respective owner

Related posts about c++

Related posts about c