October 19, 2001 Initialization external variable | ||||
---|---|---|---|---|
| ||||
How correctly to initialize external variable? For example code (test1.c): const int axx = 3; int b = axx; void main(void) { } At compilation: sc test1.c -c -mx There is a mistake: test1.c(2) : Error: constant initializer expected --- errorlevel 1 |
October 20, 2001 Re: Initialization external variable | ||||
---|---|---|---|---|
| ||||
Posted in reply to ZaitcevE.V. | Your code is correct C++, but not correct C. Try using the -cpp flag to tell the compiler it is C++. -Walter ZaitcevE.V. wrote in message <9qoejg$42v$1@digitaldaemon.com>... >How correctly to initialize external variable? >For example code (test1.c): > >const int axx = 3; > int b = axx; > >void >main(void) > { > } > >At compilation: sc test1.c -c -mx >There is a mistake: >test1.c(2) : Error: constant initializer expected >--- errorlevel 1 > > > > > > |
Copyright © 1999-2021 by the D Language Foundation