www.digitalmars.com         C & C++   DMDScript  

c++.dos.32-bits - Initialization external variable

reply "ZaitcevE.V." <Genior km.ru> writes:
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
Oct 18 2001
parent "Walter" <walter digitalmars.com> writes:
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
Oct 19 2001