Possible Duplicate:
Is typedef and #define the same in c?
Confused by #define and typedef
Is there any difference between the following:
#define NUM int
...
NUM x;
x = 5;
printf("X: %d\n", x);
And this:
typedef int NUM;
...
NUM x;
x = 5;
printf("X : %d\n", x);
Both tests compile and run without problems. So, are they equivalent?
Thanks.