#include <stdio.h>
#include <stdbool.h>
#include <ctype.h>
#define CHECK(x,y,n) ((x) > 0 && (x) < (n) && (y) > 0 && (y) < (n) ? 1 : 0)
#error(index) fprintf(stderr, "Range error: index = %d\n",index)
int main(void)
{
/*char s[5];
int i;
strcpy(s,"abcd");
i = 0;
putchar(s[++i]);*/
int i = CHECK(10,50,45);
printf("%d",i);
return 0;
}
I tries to do error input that takes an argument because macro can do that but when i try to build and compile i get this error message
#error (index) fprintf(stderr, "Range error: index = %d\n",index)
can i have an argument in the error directive or fprintf
or whats is wrong?