home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!news.univie.ac.at!chx400!sicsun!siisg1.epfl.ch!lapique
- From: lapique@siisg1.epfl.ch ( Francis Lapique)
- Newsgroups: comp.sys.sgi
- Subject: C++/bug
- Message-ID: <4340@sicsun.epfl.ch>
- Date: 19 Nov 92 18:30:32 GMT
- Sender: news@sicsun.epfl.ch
- Lines: 52
-
- A very interesting bug with C++ release 3.0(maint_c++ C++ Maint, 3.0)
- Compiling the following program:
- -----------------------------------
- #include <iostream.h>
- #include <math.h>
- class Point
- {
- double x,y;
- public:
- Point(double abs, double ord)
- { x = abs ; y = ord;
- cout << x << " " << y << "\n";
- }
- };
- main()
- {
- Point p1(1.,2.), p2(3.,5.);
- }
- output OK:
- 1 2
- 3 5
- now compiling:
- ---------------------------
- #include <iostream.h>
- #include <math.h>
- class Point
- {
- double x,y;
- public:
- Point(double, double);
- };
- Point::Point(double abs, double ord)
- { x = abs ; y = ord;
- cout << x << " " << y << "\n";
- }
- main()
- {
- Point p1(1.,2.), p2(3.,5.);
- }
- output !!!!!!:
- 5.29981e-315 2
- 5.30758e-315 5
- --------------------------------
- Is C++3.0 a garbage_compiler ?
- --
- Francis Lapique-EPFL/Computer Center
- -----------------------------------------------------------------
- Swiss Federal Institute of Technology-Lausanne
- E-Mail : lapique@sic.epfl.ch/lapique@siisg1.epfl.ch
- Voice-Mail : (41)-21-693-45-96
- Fax: (41)-21-693-22-20
- -----------------------------------------------------------------
-