79654908

Date: 2025-06-05 17:02:35
Score: 2.5
Natty:
Report link

Thanks everyone. I now understand the difference between the two. Now suppose our goal is to read data from the console. The common and portable approach is to use fgets to read from stdin. But stdin can be redirected to other things (such as files). ReadConsole is an API of win32api, which is used to read content from the console bound to the program. When stdin and the console are still connected (that is, when it is not redirected), the effects of the two are basically the same. If stdin is redirected, ReadConsole still reads the input data of the console bound to the program, rather than the stdin data stream.

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-0.5):
  • No code block (0.5):
  • Self-answer (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Song Zihuan