This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ARM MDK: Why does this not compile?

Hi,

I hope someone can help. Code with comments explaining
the problem is shown below.

char const char_set1[42] =      {'A','B','C','D','E','F','G','H',
                             'I','J','K','L','M','N','O','P',
                                   'Q','R','S','T','U','V','W','X',
                               'Y','Z','.','-','%','/',':','0',
                                 '1','2','3','4','5','6','7','8','9',' '};



[I then wish to declare a constant pointer to the array]

[The following declaration compiles:]

char const* char_set_arrayA = char_set1;

[But the following declaration fails:]

char const*  char_set_arrayB[]={char_set1};

Eventually I need to pass a series of character set arrays into this declaration but I cannot get it to compile with one array element (char_set1).

I would be grateful for any advice as to why

char const* char_set_arrayB[]={char_set1};

is not accepted by the compiler. The compiler reports

"error #28: expression must have a constant value"

Is the const declaration incorrect?

Thanks

John McLane