delorie.com/archives/browse.cgi | search |
From: | remove_this_mimo AT restoel DOT net_and_this (mimo) |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: How do I fix this "warning"? |
Date: | Thu, 27 May 1999 22:59:35 GMT |
Organization: | MimoLand |
Lines: | 35 |
Message-ID: | <37497655.15261353@news.wanadoo.fr> |
References: | <TTye1DAtZaQ3Ewmi AT dunvegan1 DOT demon DOT co DOT uk> |
NNTP-Posting-Host: | tntaub161-83.abo.wanadoo.fr |
Mime-Version: | 1.0 |
X-Trace: | wanadoo.fr 927845751 4314 164.138.207.83 (27 May 1999 22:55:51 GMT) |
X-Complaints-To: | abuse AT wanadoo DOT fr |
NNTP-Posting-Date: | 27 May 1999 22:55:51 GMT |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
On Tue, 18 May 1999 18:42:05 +0100, Paul Richards <Paul AT dunvegan1 DOT demon DOT co DOT uk> wrote: >Hi, >How do I fix the warning that I get from the compiler on this: > extern Ship* const pships=(new Ship[num_bots]); >The compiler gives me a warning saying "'pships' is initialised and >declared 'extern'". > >And why does that generate a warning when something like: > extern const double height=15.6; >doesn't? try the following: class Ship { }; const int num_bots = 5; extern Ship* const pships; Ship* const pships=(new Ship[num_bots]); i dont see why you would want to initialize a extern const double (in a .h-file). if anything is declared const it means that it has a constant value without your project - means that there is a good chance that you might initialize it twice (means normally differently). cheers mimo
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |