i need a way to initialize const elements of an array for the program i am currently working on. The problem is that i have to initialize these elements with a function, there is no way to do it like this:
const int array[255] = {1, 1278632, 188, ...};
because its alot of data i have to generate. What i tried is to memcpy data to the const int's but that can't work and hasn't worked.
 const int array[255];
 void generateData(){
      for(int i = 0; i < 255; i++) {
          initializeSomehowTo(5, array[i]);
      }
 }
I hope you understand what i am trying, sorry if i doubled the question, i must have overlooked it.
const int array[255] = initializeMyArray(), but if you usedstd::array, you could doconst std::array<int, 255> = initializeMyArray()