Preprocessor Directives 369
#endif
#endif
#endif
#endif
I
LARGE1
Explanation In the above program the preprocessor directives activates the only one macro based
on the memory model currently selected on the system. Remaining five macros are undefined. The
ladder of # i f . # e ls e . # en d if checks definition of all the six macros. When it finds the defined
macro it is displayed.
11.14 STANDARD I/O PREDEFINED STREAMS IN s t d io . h
The Predefined streams automatically opens when the program is started. The Table 11.8 describes
their macro expansion defined in s t d io . h header file.
Table 11.8 Standard I/O Predefined Macros in stdio.h
Macros
Function Definition in stdio.h
stdin
Standard input device.
#def ine stdin (&_strearns [0] )
stdout
Standard output device.
#de£ine stdout (&_str earns [1] )
stderr
Standard error output device.
#def ine std err (&_str earns [2] )
stdaux
Standard auxiliary device.
#define stdaux (&_streams [3 ])
stdpm
Standard printer.
#de£ine st<^>m (&_strearns [4 ])
11.17 Write a program to enter text and display it using macro expansions.
#include <stdio.h>
# include <conio.h>
void main ()
{
char ch [12] ;
in t i ;
c lrs c r ( ) ;
printf("Input a Text: “);
for (i=0,i<11,i++)
eh[i]=getc(&c_streams[0]);
printf("Text Inputted:
for (i=0,i<ll,H++)
putc(ch[i],&c_streams[l]);
OUTPUT:
Input a Text: Programming
Text Input: Programming
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.79.84