home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!jvnc.net!yale.edu!ira.uka.de!chx400!sicsun!siisg1.epfl.ch!lapique
- From: lapique@siisg1.epfl.ch (Francis Lapique)
- Newsgroups: comp.sys.sgi
- Subject: C++ 3.0
- Message-ID: <3922@sicsun.epfl.ch>
- Date: 1 Sep 92 15:45:24 GMT
- Sender: news@sicsun.epfl.ch
- Lines: 39
-
- The following code illustrates an anomaly between
- IRIX 4.0.5 maint C++3.0 and version IRIX 4.0.5 C++2.1.1:
- -----------------------------------------------------------
- #include <string.h>
- class String {
- private:
- char *data;
- public:
- String(char *value =0){
- data = new char[strlen(value) + 1];
- strcpy(data,value);
- }
- };
- main()
- {
- const String B = "Hello World";
- }
- -------------------------------------------------------------
- Compiled with C++3.0 :
-
- accom: Error: string.C, line 13: __2__X1 undefined
- struct String __1B = (*( (__2__X1 = "Hello World"), ( ((
- -------------------------------------------------^
- accom: Error: string.C, line 13: illegal combination of pointer and integer, op =
- struct String __1B = (*( (__2__X1 = "Hello World"), ( ((
- -------------------------------------------------^
- accom: Error: string.C, line 13: types : int versus pointer to char
- struct String __1B = (*( (__2__X1 = "Hello World"), ( ((
- -------------------------------------------------^
- accom: Error: string.C, line 14: redeclaration of __2__X1
- char *__2__X1 = 0 ;
- --------------^
- Compiled with C++2.1.1 : OK
- ---------------------------------------------------------------------
- Francis Lapique
- Swiss Federal Institute of Technology-Lausanne
- Computer Center-SIC/SII
- E-mail : lapique@sic.epfl.ch
- voice : 41-21-693-4596
-