delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/04/21:32:24

From: "DeHackEd" <Not DOT given AT out>
References: <c2b00813 DOT 34d511b2 AT aol DOT com>
Subject: Re: Two c++-parser problems
Date: Wed, 4 Feb 1998 21:14:58 -0500
Lines: 59
Message-ID: <#UWw8xdM9GA.174@upnetnews04>
Newsgroups: comp.os.msdos.djgpp
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Try using a hex command \x?? to insert the value. Then GCC can't complain
because \x?? means a special symbol.

And the second error occurs because the command >> is the binary shift command
or the istream receive operator. That one always makes me wonder - isn't cout <<
"Hello world!"; usually a binary shift of "cout" left a few thousand places
(because the pointer will probably in the range of 2048+ at least...), but then
C++ would considder it a re-write of the default commands. Odd but unusual way
of using the language to your advantage.

--
"DeHackEd"

EMail address not given out due to low-life spammers.


Bitland AT aol DOT com wrote in message ...
>
>Found two C++-parserproblems, which *imho* shouldn't be there:
>
>// ----- First one:
>
>class A
>{ public:
>   char *string;
>
>   A(char *s) : string(s) {}
>};
>
>class B : public A
>{ public:
>   B(void) : A("doesn't work here with language-specific letters !") {}
>};
>   // i.e. german letters in the string will produce 'parser error'
>'unterminated string'
>
>B test;
>
>main()
>{ A *test = new A("but here it works !");
>  delete test;
>}
>
>// -----
>
>Templates of templates:
>
>i.e.:   MyList<MyArray<MyString>>     (oh yes, I do such things !)
>
>Parser has problems with the final >>
>No more problem, if you type a blank between there.
>
>If somebody knows a solution for the first problem, please mail me.
>Andy Kluge -- *\o/* --- Wiesbaden, Germany ---------- bitland AT aol DOT com
>
>                     - - - - - - OOP is when flags are set at half-mast - - -
>- - -


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019