Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!uunet!taumet!mike From: mike@taumet.com (Michael S. Ball) Newsgroups: comp.lang.c++ Subject: Re: Mixing C and C++ Message-ID: <671@taumet.com> Date: 16 Apr 91 13:55:53 GMT References: <72092@brunix.UUCP> <670@taumet.com> <72158@brunix.UUCP> Reply-To: mike@taumet.UUCP (Michael S. Ball) Organization: Taumetric Corporation, San Diego Lines: 16 In article <72158@brunix.UUCP> sdm@cs.brown.edu (Scott Meyers) writes: >As an example, suppose I have the following in C: > > const x = 10; /* global */ > int y = x + 1; /* global */ No, you can't rest easy with this initialization since it is quite illegal in C. The value of a global initializer must be a constant expression, which this is not since it involves the value of the variable x (which happens to be of type "const int"). It is legal in C++, of course. Whether particular C and C++ compilers will work together is a matter to discuss with your compiler vendors. Not all C compilers for a given machine will work together. -- Michael S. Ball mike@taumet.com TauMetric Corporation (619)697-7607