Hi,
i have a doubt regarding conditional macros and undef directive.
can i use undef for a function like - macro, by just specifying the name of the macro with out specifying the argument list as written in line 8.
is the code correct with out these statements:
#define OPER(A+B) ((A) * (B))
#endif
is the below statement correct
#if!defined(OPER)
define OPER(A+B) ((A) * (B))
i found these in one interview.
void Call( void );
#define OPER(A,B) ((A) + (B))
int main()
{
#undef OPER;
Call();
return 0;
}
void Call()
{
#if!defined(OPER)
#define OPER(A+B) ((A) * (B))
#endif
int res = OPER(10,15);
printf("res = %d \n", res);
return ;
}