Can I create variables during compiling time in in c++. I have an array with 729 elements. I want to divide it into 81 arrays each consists of 9 elements. I do not want to declare 81 arrays. I am thinking maybe there is a way I can use a "for" loop to do it for me.
The title of your post poses an XY problem (see: http://xyproblem.info/ ). Fortunately you have provided a little information about your actual problem.
Consider declaring an array of arrays. int x[81][9]; // 81 arrays of 9 int;
Or using pointer arithmetic.
1 2
int* block_n(int* x, int n)
{ return x + (n * block_size) }
More sophisticated solutions are available if required.