Re: stdin ? stdin ? What's wrong with stdin?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Frank Hickman [MVP] (fhickman_NOSP_at_M_noblesoft.com)
Date: 02/17/05


Date: Thu, 17 Feb 2005 13:03:19 -0500


"Norman Bullen" <norm@BlackKittenAssociates.com.INVALID> wrote in message
news:wH1Rd.2515$IU.2340@newsread3.news.pas.earthlink.net...
> Frank Hickman [MVP] wrote:
>>
>>
>> stdin, stdout and stderr are FILE* streams that are created and opened
>> when the CRT initializes a console application, they are not macros.
>> Have you included the proper header file in the module that is reporting
>> this?
>>
>>
>>
> Actually, stdin, stdout, and stderr ARE macro.
>
> #define stdin (&_iob[0])
> #define stdout (&_iob[1])
> #define stderr (&_iob[2])
>
> Macro expansion results in an expression that is a FILE * but the names
> stdin, etc. are not visible in the debugger because they are macros.
>
> Norm
>
> --
> --
> To reply, change domain to an adult feline.
>

DOH! That's what I get for assuming...

-- 
============
Frank Hickman
Microsoft MVP
NobleSoft, Inc.
============
Replace the _nosp@m_ with @ to reply.


Relevant Pages

  • Re: Redirect stdin ?
    ... I have a c application that parses from stdin. ... lex and yacc generated source code. ... override those macros as needed to define different input sources. ... of the file as can actually fit into your buffer at any given time. ...
    (comp.lang.c)
  • Must stdin, stdout, and stderr be macros?
    ... Are stdin, stdout, and stderr required to be macros? ...
    (comp.std.c)
  • Re: Files & dirs: historical reasons?
    ... stdin, stdout and stderr, are macros ... which expand to expressions of type FILE *. ... associated macros. ... Requiring that FILE ...
    (comp.lang.c)
  • Re: define question
    ... int main ... All other macros works right but setkey() must print when I ... You're not pressing anything in any console. ...
    (comp.lang.c)
  • Re: Files & dirs: historical reasons?
    ... I don't believe that the standard requires that they be macros. ...
    (comp.lang.c)