Click here to Skip to main content
15,908,901 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to use the Stdin and stdout function c under windows operation system..


Give sample coding
Posted

stdin and stdOut aren't functions: they are streams. You hand the stream to a function in order to read from it:
char string[256];
printf( "Please enter a long string: " );
fgets ( string, 256, stdin );
or
fputs("Hello world", stdout);
 
Share this answer
 
Comments
@BangIndia 1-Jul-11 8:47am    
i accept . but how to get the data back from the stdin file pointer
OriginalGriff 1-Jul-11 8:51am    
Um. Look at the answer?
@BangIndia 2-Jul-11 1:44am    
thanks sir..

please one small doubt..

may i assign the stdin to the other file pointer ..

FILE *fp;
fp=stdin;
like that...
OriginalGriff 2-Jul-11 4:07am    
Yes. But you will get problems if you try to write to it.
Dear aimdharma,

//Under c windows os


"stdin" stands for standard input
"stdout" stands for standard output
"stderr" stands for standard error

It's Function prototypes are defined in "stdio.h" headre file.
Just include it in ur code
#include <stdio.h></stdio.h>

and use it's library functions.

ex. you may be using

scanf("",);  //stdin function.    
     printf("");  //stdout function


I hope u get something

ok see u
 
Share this answer
 
Comments
@BangIndia 2-Jul-11 1:47am    
ya.. sir .. i get your valuable words..
thanks. for that..
Awa_tcp 2-Jul-11 1:58am    
Welcome

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900