how to define a constant array in c/c++?
In C++
const int array[] = { 1, 2, 3 };
That was easy enough but maybe I'm not understanding your question correctly. The above will not work in C however, please specify what language you are really interested in. There is no such language as C/C++.
In C++ source file
extern "C" const int array[] = { 1, 2, 3 };
In header file to be included in both C and C++ source file
#ifdef __cplusplus
extern "C" {
#endif
extern const int array[];
#ifdef __cplusplus
}
#endif
In C++, the most common way to define a constant array should certainly be to, erm, define a constant array:
const int my_array[] = {5, 6, 7, 8};
Do you have any reason to assume that there would be some problem on that embedded platform?