So I have a bunch of static const arrays of unsigned type. I declare them in the header and initialize them in a cpp file. The arrays are quite large (They are carrier indices of an OFDM based Transmitter). However I have the values from a document. So it is just a matter of copy paste for initialization. So far this works fine.
However I need a second set of arrays which are nothing but the original set + a constant value.
in header
class C
{
static const uint32_t A[288];
static const uint32_t A_ext[288];
}
in cpp
const uint32_t C::A[288] = {1,2,3......};
I want A_ext to be
A_ext[i] = A[i] + 5;
I want these also to be defined as static const because all these arrays are meant to be read only everywhere else in the project. They are like standard tables which can be accessed everywhere else in the project.
How do I go about doing this?
+5then you dont need to keep it in memory, you could use a function to access the same array and add 5A_ext, why not create a simple class which overloadsoperator[]to basically just doreturn A[i] + 5?inlinefunction to get the value fromAas well, so you have a consistent interface for bothAandA_ext.