Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > cout & cerr

Reply
Thread Tools

cout & cerr

 
 
Mike Wahler
Guest
Posts: n/a
 
      05-24-2004
"regisser" <(E-Mail Removed)> wrote in message
news:RYcsc.31010$(E-Mail Removed)...
> Is it true that cin,cout, etc are initialized on first use?


No. When 'main()' begins (and before any file scope constructors
are invoked), you are guaranteed that the 'standard streams' e.g.
'std::cin', 'std::cout', etc. have been initialized and are ready for use.

> And that no runtime initialization before main is needed;


Exactly when and how the standard streams are initialized is
implementation-dependent, but they will be ready for use before
any file scope constructors or 'main()' begins.

> the first time the object is
> accessed,


... has no bearing upon anything.

>it grabs dynamic memory typically like 1K of
> memory?


The standard streams might or might not use 'dynamic memory',
that's implementation-dependent.

Where did you hear or read of the notions you describe?

-Mike


 
Reply With Quote
 
 
 
 
regisser
Guest
Posts: n/a
 
      05-24-2004
Is it true that cin,cout, etc are initialized on first use? And that no runtime initialization before main is needed; the first time the object is accessed, it grabs dynamic memory typically like 1K of memory?

Thanks

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirect cout and cerr to System.out and System.err Will Lichtenberger Java 3 11-05-2008 10:38 AM
Redirecting cout/cerr to System.out/System.err william.lichtenberger@gmail.com Java 0 09-17-2008 09:40 PM
Overriding std::cout or std::cerr Jim Langston C++ 3 08-15-2006 03:57 AM
cout, cerr and I/O redirection Rick N. Backer C++ 2 07-15-2005 12:17 AM
function to format message & output to cerr/cout/ostream Trevor C++ 2 11-02-2003 11:51 PM



Advertisments