Re: About stdin & stdout
From: Carl Daniel [VC++ MVP] (cpdaniel_remove_this_and_nospam_at_mvps.org.nospam)
Date: 03/19/04
- Next message: John Swift: "simple question about replacing CObArray and CObList"
- Previous message: H: "(MSVCRT.DLL): 0xC0000005: Access Violation"
- In reply to: Robe: "About stdin & stdout"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 18 Mar 2004 22:12:12 -0800
Robe wrote:
> Hi,
>
> I need to know how does work exactly the "stdin" and "stdout". I
> guess that this is a mechanism used by the operating system and not
> by Visual C++.
stdin and stdout are variables defined in and managed by the C runtime
library. They're actually just constants (0 and 1 or 1 and 2 - I don't
recall) that correspond to pre-opened files. The C runtime library startup
code takes care of connecting them to the OS standard input and standard
output streams.
> Where can I get a good information about this mechanism.
Any C or Unix programming book will talk about stdin and stdout. The VC++
documentation, including what's available online on MSDN describes them from
a VC++ perspective. The CRT source code, which is included with VC++ can be
examined for any really down and dirty questions.
If you're really after the Win32 (OS level) Standard Input and Standard
Output, you might try looking up GetStdHandle() on MSDN or in the VC++ help
as a starting point.
-cd
- Next message: John Swift: "simple question about replacing CObArray and CObList"
- Previous message: H: "(MSVCRT.DLL): 0xC0000005: Access Violation"
- In reply to: Robe: "About stdin & stdout"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|