//PreProcessor Conditional Compilation
#include<stdio.h>
#include<conio.h>
#define Num 85
int main(void)
{
clrscr();
#ifdef Num
printf("Num is Defined to %d",Num);
#endif
#ifndef Number
#warning Number is not defined
printf("\nNumber is Not Defined");
#else
#error Preprocessor NEVER reaches here
printf("\nNumber is Defined to %d",Number);
#endif
getch();
return 0;
}
error as unknown preprocessor directive:warning
Page 1 of 13 Replies - 413 Views - Last Post: 01 January 2013 - 06:17 AM
#1
error as unknown preprocessor directive:warning
Posted 27 December 2012 - 09:40 AM
im tring to use C Preprocessor directive #warning, but im getting error in ma code
Replies To: error as unknown preprocessor directive:warning
#2
Re: error as unknown preprocessor directive:warning
Posted 27 December 2012 - 09:52 AM
#warning is not a standard directive - it's not supported by all compilers. If you get an error when trying to use #warning, you might be using a compiler that does not support it.
#3
Re: error as unknown preprocessor directive:warning
Posted 27 December 2012 - 09:56 AM
& seeing conio.h in there, I would assume either this code came from a project designed to be used with the Borland Turbo C++ compiler, or that is what you are using. Either way I agree with sepp2k that the code as designed will not work with whatever compiler you are using.
#4
Re: error as unknown preprocessor directive:warning
Posted 01 January 2013 - 06:17 AM
yes sepp2k is right, i also googled for this n found similar result's.
@no2pencil, yes i used this in turbo c++ compiler.
@no2pencil, yes i used this in turbo c++ compiler.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|