0

How's it going:
How do you use fopen() to establish a stream to console I/O (keyboard)? What I needed to do is read in data from the console I/O and then send it elsewhere using fputs. I just don't know what the first argument for fopen("here", r) would be. Oh, and this is an event driven program (chatting); and the fopen will be part of a read event handler. I am supposed to read data from the console using fgets and then send it out to the other recipient using fputs. Thanks.

3
Contributors
2
Replies
4
Views
11 Years
Discussion Span
Last Post by Ancient Dragon
0

How's it going:
How do you use fopen() to establish a stream to console I/O (keyboard)? What I needed to do is read in data from the console I/O and then send it elsewhere using fputs. I just don't know what the first argument for fopen("here", r) would be. Oh, and this is an event driven program (chatting); and the fopen will be part of a read event handler. I am supposed to read data from the console using fgets and then send it out to the other recipient using fputs. Thanks.

Its not necessary to use fopen to open the console keyboard -- its already open when the program starts. You can use stdout, stdin or stderr.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.