Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!sun!amdahl!lms From: lms@uts.amdahl.com (Linda Sorauf) Newsgroups: comp.lang.c++ Subject: cout in static object constructors Message-ID: <76LR01ly7a2m00@amdahl.uts.amdahl.com> Date: 23 May 91 19:50:12 GMT Reply-To: lms@amdahl.uts.amdahl.com (Linda Sorauf) Organization: Amdahl Corporation, Sunnyvale CA Lines: 31 I have a question regarding using cout in constructors of static objects. I hope I can word the question clearly.... Basically, I have been warned against using cout in constructors of static objects. Apparently, cout, which is itself not static, relies on a static object called iostream_init. The danger is that the order of static object construction may be such that cout is used before iostream_init has been constructed. Can someone explain to me 1) is this even true, should I avoid using cout in constructors of static objects? 2) if so, why? 3) how can I create a test case where this failure happens? I have tried every sort of file and include arrangements I can think of, but cannot create such a failure. I am quite sure that I have been able to use cout before iostream_init is constructed, but in my simple programs, things seem to work fine. Thanks in advance, Linda Sorauf lms@uts.amdahl.com UTS CASE development Amdahl Corp. -- - - - - - - - - - - - - Linda Sorauf lms@uts.amdahl.com #include