I have defined the following static const array:
const int arr[197] = { 55, -63, 12, -17, 121 , ... };
The array never changes. It contains some specific numerical pattern eligible for my program. This array is used in three different files:
foo1()infile1.cfoo2()infile2.cfoo3()infile3.c
everytime passing the array to a function as an argument.
Because the definition of this array is quite long and extensive, I want to create separate file just to define and keep that array in there.
How should that be done properly? Should I define that array in let's say arr.h and then put #include <arr.h> inside .c files that use this array?
.hand define in.carr.c, declare asexterninarr.hand then#include <arr.h>inside.cfiles that will use the array? :)