home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!sunic!corax.udac.uu.se!Minsk.docs.uu.se!rogerl
- From: rogerl@Minsk.docs.uu.se (Roger Lundberg)
- Newsgroups: comp.lang.c++
- Subject: Bug in BC/C++ 2.0 ?
- Date: 18 Dec 92 17:21:49 GMT
- Organization: Uppsala University
- Lines: 32
- Message-ID: <rogerl.724699309@Minsk>
- NNTP-Posting-Host: minsk.docs.uu.se
- Summary: Is this a bug in BC 2.0 ?
- Keywords: bugs
-
-
- I recently bought a copy of Borland C/C++ v. 2.0 (I know it's a bit old, but I
- got for a decent price :-). So I thought I would try it out with a small prog
- that I copied from Stroustrups "The C++ Programming Language" 2nd ed. The prog
- was the "class string" example. But BC wouldn't compile ? It barfed at all
- constructs of the following type.
-
-
- String::~String() {
- if ( --p->n == 0) {
- delete[] p->s;
- /* ^^^^^ Here does the compiler barf */
- delete p;
- }
- }
-
-
- It gave an error message indicating that it interpreted the "->" construct as
- a minus sign "-" followed by garbage. Is this a bug in BC 2.0 or is the example
- in the book at fault ???
-
- I have used the same example with gcc with no problems at all.
-
- /Roger
-
-
-
- --
- Roger Lundberg
- E-Mail: rogerl@Minsk.DoCS.UU.SE
- Tel.: +46 (0)18-460346
- Mail: Sernanders v. 8-512 , S-75261 Uppsala , Sweden
-