A
akins.steve
Is it possible to write a function that uses stdout for both output
and input? What I mean to say is, I can obviously write a line to
stdout to ask for input, ie:
fprintf(stdout, "%s\n", prompt);
Then in order to read the response, I would use:
fgets(user_input, MAX_LINES, stdin);
Is that the correct way to do it? Is there ever an instance where
this would work:
fgets(user_input, MAX_LINES, stdout);
Thanks from an obviously green C programmer!
and input? What I mean to say is, I can obviously write a line to
stdout to ask for input, ie:
fprintf(stdout, "%s\n", prompt);
Then in order to read the response, I would use:
fgets(user_input, MAX_LINES, stdin);
Is that the correct way to do it? Is there ever an instance where
this would work:
fgets(user_input, MAX_LINES, stdout);
Thanks from an obviously green C programmer!