Path: utzoo!attcan!uunet!huxley!glenn From: glenn@huxley.huxley.bitstream.com (Glenn P. Parker) Newsgroups: comp.lang.c++ Subject: Re: Are global class objects special? Message-ID: Date: 27 Sep 90 14:03:40 GMT References: <26729@mimsy.umd.edu> Sender: glenn@huxley.UUCP Reply-To: (Glenn Parker) Distribution: comp Organization: Bitstream, Inc. Lines: 18 In-reply-to: wilson@brillig.cs.umd.edu's message of 26 Sep 90 20:33:45 GMT In article <26729@mimsy.umd.edu> wilson@brillig.cs.umd.edu writes: > Am I right that there is no way to vary a parameter to > a constructor for a class object having global scope > without recompilation? I don't know about g++, but C++ allows you to initialize a global object using a function call. A function for a random seed might query the O.S. for the time, or some such value. Of course, you should not rely on facilities like the streams library during this initialization, since they require some initialization of their own. An alternative (if the previous suggestion is not supported in g++) would be to declare a global pointer to an object that is constructed in main(). -- Glenn P. Parker glenn@bitstream.com Bitstream, Inc. uunet!huxley!glenn 215 First Street BIX: parker Cambridge, MA 02142-1270