I'm somewhat new to C. I am wondering, is the
This POSIX function is deprecated. Use the ISO C++ conformant _read instead.
fread(buf, 1, sizeof(buf), stdin)
read(STDIN_FILENO, buf, sizeof(buf))
read() is not and never has been standard C, so if you want to write portable code which reads from files, don't use it; use
On the other hand, there may be things you want to do on a Posix system which are not portable, such as use pipes and sockets. In that case, go ahead and use the Posix interfaces.