|
 |
On Fri, 07 May 1999 13:46:56 -0400, Phil Clute <pcl### [at] tiac net> wrote:
>I have to admit my experience with C programming is extremely
>limited. I guess I am confused as to what a "macro" is then.
>I assumed that constants were macros. What makes #define a
>macro and #declare not a macro? They seem to serve the same
>purpose.
C's #define lets you do
#define FOO(x,y,z) (x*32+y*z)
which you can then use like a function:
printf( "%d", FOO(1,2,3) );
whereas #declare creates an actual instance of the specified
object and puts it in a "variable." #declare is a lot like the
BASIC "Let" statement.
#macro is pretty much the same as #define, but with a little
different syntax.
Post a reply to this message
|
 |