Question: Whenever I execute a C program, there are 3 standard files, `stdin`, `stdout`, `stderr`. Theses map to `/proc/self/fd/0`, `/proc/self/fd/1`, `/proc/self/fd/2` in Linux, which link to `/dev/pts/0` in my computer. This is pseudo-terminal, to which this process outputs to and takes inputs from.

What is the equivalent of this in Windows? Where do these `stdin`, `stdout`, `stderr` point to, when I execute same program in Windows?

Answer: 
They don't exist as files on Windows. Even though Windows NT has a object manager in the kernel where named kernel objects exist, the console is not part of it.

At the Win32 layer, those 3 handles are returned by [`GetStdHandle`](https://learn.microsoft.com/en-us/windows/console/getstdhandle). They are special handles and when `WriteFile`/`ReadFile` are called, they check for these special handles and reroutes the request to the console API internally. On the other hand, if a std handle is redirected then the handle can be a real file on disk or a pipe and normal I/O is performed. `CON`, `CONIN$` and `CONOUT$` are special names known by `CreateFile` and provides access to the console screen buffers but this is not exactly the same thing as the handles from `GetStdHandle`.

The C run-time library sits on top of Win32 and provides another level of abstraction. Internally it will have mappings to/from std, FILE\* and the native Win32 HANDLE.
There is no direct equivalent of /dev/stdin and other Unix pseudo files.

You could create a named pipe (CreateNamedPipe) but it isn't exactly identical.

The windows files conIN$ and conOUT$ are similar, but they only read or write to the current window.