home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / cplus / 13210 < prev    next >
Encoding:
Internet Message Format  |  1992-09-02  |  1.4 KB

  1. Xref: sparky comp.lang.c++:13210 comp.os.ms-windows.programmer.misc:1647 comp.os.ms-windows.programmer.tools:839
  2. Newsgroups: comp.lang.c++,comp.os.ms-windows.programmer.misc,comp.os.ms-windows.programmer.tools,comp.windows.ms.programmer
  3. Path: sparky!uunet!gumby!wupost!decwrl!borland.com!pete
  4. From: pete@genghis.borland.com (Pete Becker)
  5. Subject: Re: I Borland C++/Win 3.1 Broken??? Help!
  6. Message-ID: <1992Sep2.160633.4811@genghis.borland.com>
  7. Originator: pete@genghis.borland.com
  8. Sender: news@borland.com (News Admin)
  9. Organization: Borland International
  10. References: <1992Sep1.213224.7550@actrix.gen.nz>
  11. Date: Wed, 2 Sep 1992 16:06:33 GMT
  12. Lines: 28
  13.  
  14. In article <1992Sep1.213224.7550@actrix.gen.nz> David.Haigh@bbs.actrix.gen.nz writes:
  15. >Here's the situation:
  16. >
  17. >The following member function compiles without error, using Turbo C++
  18. >for Windows 3.0.
  19. >
  20. >virtual int yield( volatile BOOL & continueYield = TRUE);
  21. >
  22. >BOOL : typedef for int
  23. >TRUE : #define 1
  24. >
  25. >However, using Borland C++ for Windows 3.1, the following errors are generated:
  26. >
  27. >* Reference initialised with 'int', needs lvalue of type int.
  28. >* Type mismatch in default value for parameter 'continueYield'.
  29. >
  30.  
  31.     The second error is a result of the first, so don't worry about that
  32. one.  The problem is that the code is trying to pass a constant object as a
  33. reference parameter.  What happens in this case?
  34.  
  35.     int yield( int& b )
  36.     {
  37.     b = 0;
  38.     }
  39.  
  40.     yield(1);
  41.  
  42.