www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/26/01:53:22

From: remove_this_mimo AT restoel DOT net_and_this (mimo)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: c++ const definition in djgpp 2.95 problem
Date: Wed, 25 Aug 1999 17:28:13 GMT
Organization: MimoLand
Message-ID: <37c2cd61.5065024@news.kfunigraz.ac.at>
References: <37c18ffb DOT 1378453 AT news DOT kfunigraz DOT ac DOT at> <37C1A47D DOT 40442E34 AT NortelNetworks DOT com>
NNTP-Posting-Host: bonlineb110.kfunigraz.ac.at
Mime-Version: 1.0
Lines: 50
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Mon, 23 Aug 1999 15:43:58 -0400, "Campbell, Rolf [SKY:1U32:EXCH]"
<cp1v45 AT NortelNetworks DOT com> wrote:

>mimo wrote:
>
>> i used to define my constants like this, following advice by someone
>> who seemed to understand the ansi/iso c++ declaration:
>>
>> class c{
>>
>>   const char cszText[] = "Text";
>>   const int ciNumber = 5;
>
>    Why would you want to have constant member variables?  I think you
>should be using constant static member variables.
>
>class c {
>  static const char cszText[];
> };
>
>const char c::cszText[] = "Text";
>
>I haven't tested that, and it might not work.  You might have to use 'char
>*' instead of 'char []' but that shouldn't make any difference if they are
>constants.

thanks for trying to help me, but i tried your proposition and it
resulted in an internal compiler error - see dump...
---
 Compiling: dbbf.cpp
 In method `CDoubleBuffer::~CDoubleBuffer()':
 src/main/double/dbbf.cpp(41) Error: Internal compiler error in
`find_function
 Please submit a full bug report.
 See <URL:http://egcs.cygnus.com/faq.html#bugreport> for instructions.
 There were some errors
---
i m not sure if this does have to do with the static declaration,
anyway i miss my old style of declaring things in header files to be
easily retraceable...

cheers

mimo

btw.: i m sorry but i can't post the source-code. as far as the
problem is concerned i think it should be easy to reproduce the thing
by reading this thread.


- Raw text -


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