2 Replies Latest reply on Dec 3, 2016 2:04 PM by user_1377889

    Best Way To Establish String Constant Arrays

    ben.s.

      As part of my stereo preamplifier project, I am attempting to create messages that are stored as constants in an array of chars.

         

       

         

      const char Inputs[6][7] =  {"TUNER", "OPTICAL",
                                                  "AV", "SERVER", "PHONO", "FRONT"};

         

      I need these messages to be stored in a global header file so elements throughout my program can access them. When I declare the above line in a c file, it compiles fine. In a header file, even if I use the extern keyword, my code does not compile.

         

      What is the best method to declare a constant array of strings in a header file?