initialization of stdin, stdout, stderr

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • subramanian100in@yahoo.com, India

    initialization of stdin, stdout, stderr

    The file stdio.h just contains
    extern FILE *stdin;
    extern FILE *stdout;
    extern FILE *stderr;

    When are the standard streams stdin, stdout, stderr initialiazed ?
    How are they initialiazed ?

    Kindly explain.

    Thanks
    V.Subramanian
  • Chris Dollin

    #2
    Re: initialization of stdin, stdout, stderr

    subramanian100i n@yahoo.com, India wrote:
    The file stdio.h just contains
    extern FILE *stdin;
    extern FILE *stdout;
    extern FILE *stderr;
    There isn't such a thing as "the" file `stdio.h`. Even if we ignore
    that the standard headers don't need to be files /at all/, each
    implementation' s <stdio.hcan have different contents -- so long
    as it provides what the standard requires and doesn't intrude into
    the programmer's namespace.

    Also, if your implementation' s <stdio.honly contains what you
    mention above, it's not a conformant implementation, since it
    doesn't declare `size_t`, `FILE`, `fpos_t`, `NULL`, `fopen`,
    `fread`, `printf`, ... well, almost everything that's supposed
    to be there.

    What implementation is this?
    When are the standard streams stdin, stdout, stderr initialiazed ?
    Before `main` starts executing.
    How are they initialiazed ?
    However the implementation finds it convenient.

    --
    'Don't be afraid: /Electra City/
    there will be minimal destruction.' - Panic Room

    Hewlett-Packard Limited Cain Road, Bracknell, registered no:
    registered office: Berks RG12 1HN 690597 England

    Comment

    • Kenny McCormack

      #3
      Re: initialization of stdin, stdout, stderr

      In article <ge4g57$9v3$1@n ews-pa1.hpl.hp.com> ,
      Chris Dollin <chris.dollin@h p.comwrote:
      >subramanian100 in@yahoo.com, India wrote:
      >
      >The file stdio.h just contains
      >extern FILE *stdin;
      >extern FILE *stdout;
      >extern FILE *stderr;
      >
      >There isn't such a thing as "the" file `stdio.h`. Even if we ignore
      >blah, blah, blah
      Get real. You mean that if I refer to a particular piece of furniture
      in my office as "the desk", that I'm wrong? That somebody is going to
      come along and explain in excruciatingly patronizing terms that there is
      no such thing as "the desk" - because there are other desks in the world (*)
      and, in fact (I know we shouldn't even mention this, but what the heck!),
      there are offices in the world that don't even have a desk!!!

      (*) And, as amazing as I might find this, and as hard as it is to
      believe, they don't all look the same as my desk!!! Oh the shock!
      Oh the horror!!!

      Comment

      • Chris Dollin

        #4
        Re: initialization of stdin, stdout, stderr

        Kenny McCormack wrote:
        In article <ge4g57$9v3$1@n ews-pa1.hpl.hp.com> ,
        Chris Dollin <chris.dollin@h p.comwrote:
        >>subramanian10 0in@yahoo.com, India wrote:
        >>
        >>The file stdio.h just contains
        >>extern FILE *stdin;
        >>extern FILE *stdout;
        >>extern FILE *stderr;
        >>
        >>There isn't such a thing as "the" file `stdio.h`. Even if we ignore
        >>blah, blah, blah
        Yeah, sure, Kenny, twit the "regulars" for being unhelpful, but
        given half -- no, one-googleth -- a chance, pick on the only thing
        you can wilfully misunderstand in a posting and misunderstand it
        to death.
        Get real.
        Complex fits better.
        You mean that if I refer to a particular piece of furniture
        in my office as "the desk", that I'm wrong?
        Sure, if you're pointing to a chair or teapot, or if you're
        expecting agreement that the desk you're pointing to is /the/,
        that is the only or the definitive, desk. Is that what you're
        doing? (fx:tap-tap) I'm not getting video on this connection.

        Of course the OP might not have realised that was the implication
        of what they'd said, perhaps because of dialectic differences,
        of which I don't question the existence. Perhaps you, too, were
        unaware of this usage. Consider this a learning opportunity.
        there are offices in the world that don't even have a desk!!!
        Are you claiming that those are /conformant/ offices?
        (*) And, as amazing as I might find this, and as hard as it is to
        believe, they don't all look the same as my desk!!! Oh the shock!
        Oh the horror!!!
        Multiple exclamation marks!

        --
        Chris "excruciati ngly patronizing" Dollin

        'Don't be afraid: /Electra City/
        there will be minimal destruction.' - Panic Room

        Hewlett-Packard Limited registered no:
        registered office: Cain Road, Bracknell, Berks RG12 1HN 690597 England

        Comment

        • Keith Thompson

          #5
          Re: initialization of stdin, stdout, stderr

          Chris Dollin <chris.dollin@h p.comwrites:
          Kenny McCormack wrote:
          >In article <ge4g57$9v3$1@n ews-pa1.hpl.hp.com> ,
          >Chris Dollin <chris.dollin@h p.comwrote:
          >>>subramanian1 00in@yahoo.com, India wrote:
          >>>
          >>>The file stdio.h just contains
          >>>extern FILE *stdin;
          >>>extern FILE *stdout;
          >>>extern FILE *stderr;
          >>>
          >>>There isn't such a thing as "the" file `stdio.h`. Even if we ignore
          >>>blah, blah, blah
          >
          Yeah, sure, Kenny, twit the "regulars" for being unhelpful, but
          given half -- no, one-googleth -- a chance, pick on the only thing
          you can wilfully misunderstand in a posting and misunderstand it
          to death.
          [...]

          Chris, please don't feed the troll. If you argue with Kenny, he wins;
          don't play his game.

          --
          Keith Thompson (The_Other_Keit h) kst-u@mib.org <http://www.ghoti.net/~kst>
          Nokia
          "We must do something. This is something. Therefore, we must do this."
          -- Antony Jay and Jonathan Lynn, "Yes Minister"

          Comment

          • Phil Carmody

            #6
            Re: initialization of stdin, stdout, stderr

            gazelle@shell.x mission.com (Kenny McCormack) writes:
            In article <ge4g57$9v3$1@n ews-pa1.hpl.hp.com> ,
            Chris Dollin <chris.dollin@h p.comwrote:
            >>subramanian10 0in@yahoo.com, India wrote:
            >>
            >>The file stdio.h just contains
            >>extern FILE *stdin;
            >>extern FILE *stdout;
            >>extern FILE *stderr;
            >>
            >>There isn't such a thing as "the" file `stdio.h`. Even if we ignore
            >>blah, blah, blah
            >
            Get real. You mean that if I refer to a particular piece of furniture
            in my office as "the desk", that I'm wrong? That somebody is going to
            come along and explain in excruciatingly patronizing terms that there is
            no such thing as "the desk" - because there are other desks in the world (*)
            and, in fact (I know we shouldn't even mention this, but what the heck!),
            there are offices in the world that don't even have a desk!!!
            If your desk was in fact just a big cardboard box, would you still
            call it a desk? Yes, it acts as a desk, but it's not really a desk.
            So to the pedants, no, it's not a desk, but to the generalists,
            it may as well be a desk, who cares what it really is.
            (*) And, as amazing as I might find this, and as hard as it is to
            believe, they don't all look the same as my desk!!! Oh the shock!
            Oh the horror!!!
            Pffft! I had cardboard boxes as desks when I first moved here!

            Phil
            --
            Christianity has such a contemptible opinion of human nature that it does
            not believe a man can tell the truth unless frightened by a belief in God.
            No lower opinion of the human race has ever been expressed.
            -- Robert Green Ingersoll (1833-1899), American politician and scientist

            Comment

            • Malcolm McLean

              #7
              Re: initialization of stdin, stdout, stderr


              "Phil Carmody" <thefatphil_dem unged@yahoo.co. ukwrote in message
              >
              Pffft! I had cardboard boxes as desks when I first moved here!
              >
              Cardboard boxes? Paving stones, that's what we had. Eee, that's what it was
              like, it was.

              --
              Free games and programming goodies.


              Comment

              • Mark McIntyre

                #8
                Re: initialization of stdin, stdout, stderr

                Malcolm McLean wrote:
                >
                "Phil Carmody" <thefatphil_dem unged@yahoo.co. ukwrote in message
                >>
                >Pffft! I had cardboard boxes as desks when I first moved here!
                >>
                Cardboard boxes? Paving stones, that's what we had. Eee, that's what it
                was like, it was.
                At least you didn't have to eat gravel. Or live in t'middle o't'm62.

                Comment

                • William Pursell

                  #9
                  Re: initialization of stdin, stdout, stderr

                  On 28 Oct, 00:23, Phil Carmody <thefatphil_dem un...@yahoo.co. uk>
                  wrote:
                  gaze...@shell.x mission.com (Kenny McCormack) writes:
                  In article <ge4g57$9v...@n ews-pa1.hpl.hp.com> ,
                  Chris Dollin  <chris.dol...@h p.comwrote:
                  >There isn't such a thing as "the" file `stdio.h`. Even if we ignore
                  >blah, blah, blah
                  Some of this attribution is incorrect. It was Kenny McCormack who
                  snipped Chris Dollin's statement and wrote "blah, blah, blah"
                  (and incorrectly attributed that to Chris).
                  Get real.  You mean that if I refer to a particular piece of furniture
                  in my office as "the desk", that I'm wrong?  That somebody is going to
                  come along and explain in excruciatingly patronizing terms that there is
                  no such thing as "the desk" - because there are other desks in the world (*)
                  and, in fact (I know we shouldn't even mention this, but what the heck!),
                  there are offices in the world that don't even have a desk!!!
                  >
                  If your desk was in fact just a big cardboard box, would you still
                  call it a desk? Yes, it acts as a desk, but it's not really a desk.
                  So to the pedants, no, it's not a desk, but to the generalists,
                  it may as well be a desk, who cares what it really is.
                  >
                  I think you have the metaphor reversed. Those who claim that
                  stdio.h must be a file are the one's who would insist that
                  a cardboard box cannot be a desk. To say that stdio.h is
                  a file is like saying that a desk is a piece of mahogany
                  furniture with 3 drawers on each side, one in the middle,
                  and an ink well on the top. Anyone familiar with the
                  general notion of a desk will take exception to such
                  a claim. Similarly, the claim "stdio.h is a file"
                  in invalid.

                  Comment

                  Working...