home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c++:13210 comp.os.ms-windows.programmer.misc:1647 comp.os.ms-windows.programmer.tools:839
- Newsgroups: comp.lang.c++,comp.os.ms-windows.programmer.misc,comp.os.ms-windows.programmer.tools,comp.windows.ms.programmer
- Path: sparky!uunet!gumby!wupost!decwrl!borland.com!pete
- From: pete@genghis.borland.com (Pete Becker)
- Subject: Re: I Borland C++/Win 3.1 Broken??? Help!
- Message-ID: <1992Sep2.160633.4811@genghis.borland.com>
- Originator: pete@genghis.borland.com
- Sender: news@borland.com (News Admin)
- Organization: Borland International
- References: <1992Sep1.213224.7550@actrix.gen.nz>
- Date: Wed, 2 Sep 1992 16:06:33 GMT
- Lines: 28
-
- In article <1992Sep1.213224.7550@actrix.gen.nz> David.Haigh@bbs.actrix.gen.nz writes:
- >Here's the situation:
- >
- >The following member function compiles without error, using Turbo C++
- >for Windows 3.0.
- >
- >virtual int yield( volatile BOOL & continueYield = TRUE);
- >
- >BOOL : typedef for int
- >TRUE : #define 1
- >
- >However, using Borland C++ for Windows 3.1, the following errors are generated:
- >
- >* Reference initialised with 'int', needs lvalue of type int.
- >* Type mismatch in default value for parameter 'continueYield'.
- >
-
- The second error is a result of the first, so don't worry about that
- one. The problem is that the code is trying to pass a constant object as a
- reference parameter. What happens in this case?
-
- int yield( int& b )
- {
- b = 0;
- }
-
- yield(1);
-
-