Why this code isn’t working ? (This is not the actual code, but a simplified version)
#include <stdio.h>
#define NUMBER 5
int function( int NUMBER );
int main (void)
{
function( NUMBER );
return 0;
}
int function( int NUMBER )
{
printf("Hi %d\n", NUMBER);
return 0;
}
#defineis a pre-processor macro, simple text replacement. So, let’s look at what you are really trying to compile:Which makes no sense. This part is fine:
Because you are calling
functionwith the value5, but the signature offunctionshould look like this: