Foo is accepting a pointer to an Int. not an int value. Your define turns into an integer literal. And will work anywhere an integer literal will work.
You cannot get the address of a literal.
try :
void foo (int a) {
or actually creating a integer variable, and passing the address of it to foo, and dereferencing it in foo back to an int :
int main (void)
{
int myVar = M;
foo(&myvar)
}
void foo (int *a) {
if (*a == M) { printf("Hello!\n"); }
else if (*a == N) { printf("Goodbye!\n"); }
return;
}