Saturday, May 22, 2010

What is the difference between a preprocessor macro and an inline function in C++?

A macro is not neccesarily defining a function. An inline function does, so you can use "return %26lt;value%26gt;". A macro would use assignments instead.

What is the difference between a preprocessor macro and an inline function in C++?
the preprocessor macro is a collection of statements which are commonly used in a C++ program and to use preprocessor macro we use # include%26lt;%26gt; in a program while inline function is a function which is defined in one line only.

strawberry

No comments:

Post a Comment