yes but when this preprocessor is used in function then..
when we use it in function then?
#define USELCD 0
.
.
.
.
.
.
// the function related to LCD will be added only
// if USELCD is true(nonzero) else functions for
// displaying character on 7 segment displays
// will be added to the actual code and functions
// for LCD will be removed from the code
#if USELCD // functions for LCD
void LCD_init(void)
{
// write code for LCD Initialisation
}
void LCD_Clear(void)
{
// write code for clearing the LCD
}
void LCD_putchar(unsigned char x)
{
// write code for displaying value of x on
// LCD
}
#else // function s for 7 segments
void Clear_Segments(void)
{
// write code for clearing 7 segment
// display
}
void SevenSeg(unsigned char x)
{
//write code for displaying value of x,
// on Seven Segment Display
}
#endif
// common function for displaying
// value of a on any display
void Display(unsigned char a)
{
#if USELCD
LCD_putchar(a);
#else
SevenSeg(a)
}