Like the title says, what is the difference between using a macro, which just textually substitutes whatever, as opposed to just writing a function with reference parameters? I know there must be a difference, or else there would be no need for macros. Can someone please help me to understand the difference, possibly with an example? TIA.