home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / sgi / 16686 < prev    next >
Encoding:
Text File  |  1992-11-19  |  1.4 KB  |  62 lines

  1. Path: sparky!uunet!news.univie.ac.at!chx400!sicsun!siisg1.epfl.ch!lapique
  2. From: lapique@siisg1.epfl.ch ( Francis Lapique)
  3. Newsgroups: comp.sys.sgi
  4. Subject: C++/bug
  5. Message-ID: <4340@sicsun.epfl.ch>
  6. Date: 19 Nov 92 18:30:32 GMT
  7. Sender: news@sicsun.epfl.ch
  8. Lines: 52
  9.  
  10. A very interesting bug with C++ release 3.0(maint_c++ C++ Maint, 3.0)
  11. Compiling the following program:
  12. -----------------------------------
  13. #include <iostream.h>
  14. #include <math.h>
  15. class Point
  16. {
  17.     double x,y;
  18.   public: 
  19.     Point(double abs, double ord)
  20. {     x = abs ; y = ord;
  21.       cout << x <<  "  " << y << "\n";
  22. };
  23. main()
  24. {
  25.   Point p1(1.,2.), p2(3.,5.);
  26. }
  27. output OK:
  28. 1  2
  29. 3  5 
  30. now compiling:
  31. --------------------------- 
  32. #include <iostream.h>
  33. #include <math.h>
  34. class Point
  35. {
  36.     double x,y;
  37.   public: 
  38.     Point(double, double); 
  39. };
  40. Point::Point(double abs, double ord)
  41. {     x = abs ; y = ord;
  42.       cout << x <<  "  " << y << "\n";
  43. main()
  44. {
  45.   Point p1(1.,2.), p2(3.,5.);
  46. }
  47. output !!!!!!:
  48. 5.29981e-315  2
  49. 5.30758e-315  5
  50. --------------------------------
  51. Is C++3.0 a garbage_compiler ?
  52. -- 
  53. Francis Lapique-EPFL/Computer Center
  54. -----------------------------------------------------------------
  55. Swiss Federal Institute of Technology-Lausanne 
  56. E-Mail : lapique@sic.epfl.ch/lapique@siisg1.epfl.ch
  57. Voice-Mail : (41)-21-693-45-96
  58. Fax: (41)-21-693-22-20
  59. -----------------------------------------------------------------
  60.