I am writing a code which uses five fairly large 2D arrays of chars. Since they are pretty large, I want to have them declared and defined in a separate .h and .cpp file (?), so that they don't clutter up my implementation file but are still accessible from the implementation file just as if they were defined there.
I have been trying to do this for a couple hours now, but I'm still not sure what I'm doing. Any help would be greatly appreciated! For example, maybe I could have a quick little example of how this is done? Thanks!
The arrays are titled CH1, CH2, CH3, CH4, and CH5.
Here is a small sample of the code that defines the arrays:
But one more thing...Is there a way to set the value at every index of each of the five arrays to '0' as a default without resorting to hundreds of lines of code? I know I can do this easily with a for loop, but I don't know how to implement one in the my_arrays.cpp file.
After setting the default values, I'd like to continue using the format: