NO

Author Topic: Bug : error #2069: Initializer must be constant  (Read 4999 times)

Mikehg

  • Guest
Bug : error #2069: Initializer must be constant
« on: January 14, 2006, 06:51:23 PM »
Hi Pelle,

I believe this should not be causing an error:

In global scope:

 char   a[2048];
 char  *b=&a[4];
 char  *c=b;   <--- This line

 test.c(129): error #2069: Initializer must be constant.

Thanks,
Mike Henning

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Bug : error #2069: Initializer must be constant
« Reply #1 on: January 14, 2006, 11:46:57 PM »
Hello,

You are assigning variable b to c - this is not allowed in global scope.

Pelle
/Pelle

Mikehg

  • Guest
Bug : error #2069: Initializer must be constant
« Reply #2 on: January 15, 2006, 05:29:28 AM »
Thanks Pelle,

It must only be valid in C++. I sometimes forget they are two different languages  #-o

Mike Henning