By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,260 Members | 1,338 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,260 IT Pros & Developers. It's quick & easy.

cout & cerr

P: n/a
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

Jul 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"regisser" <om******@hotmail.com> wrote in message
news:RY******************@fe09.usenetserver.com...
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
Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.