S
sangeeta chowdhary
Hi,
I have compiled this code-
#include<stdio.h>
int main()
{
#ifdef NOTE
/* unterminated comment
int a;
a=10;
#else
int a;
a=20;
#endif
printf("%d\n",a);
return 0;
}
Now,#ifdef fails in this case and the if block doesn't go for
compilation,still errors in the if block are not permitted,how? Who
check for these errors? I heard about compile time errors,logical
errors,run time errors then in which category this error come? If
syntax error,but compiler checks for syntax error ,but this error is
displayed before compilation.
}
I have compiled this code-
#include<stdio.h>
int main()
{
#ifdef NOTE
/* unterminated comment
int a;
a=10;
#else
int a;
a=20;
#endif
printf("%d\n",a);
return 0;
}
Now,#ifdef fails in this case and the if block doesn't go for
compilation,still errors in the if block are not permitted,how? Who
check for these errors? I heard about compile time errors,logical
errors,run time errors then in which category this error come? If
syntax error,but compiler checks for syntax error ,but this error is
displayed before compilation.
}