Hi, is it possible to direct an output to the stdin stream? What command would do this if you can do it? Short post I know but it doesn't take much explaining.
Cheers
Printable View
Hi, is it possible to direct an output to the stdin stream? What command would do this if you can do it? Short post I know but it doesn't take much explaining.
Cheers
stdin is for input, stdout and stderr are for output. Use them in the same manner you would any other file stream. Does that help?
So something like putc could do it?
putc ( whatever,stdin )
if I pass the character x to putc for example and direct it to stdin would the computer read it in the same way as me pressing x on the keyboard?
No, you can't write to an input stream... the best you might be able to do is unget 1 character. But why do this with stdin?
I wasn't asking for any program in particular, it was just a thought that came to me. It would be more useful if it was the stdin of another program though.
You can do it in Windows in various ways (WriteConsoleInput, WriteFile on open standard console handles).......
Thanks a lot