My code is something like this:
class cell{
public:
int v;
int x[5];
}
cell **block; //initialized the size of the array as [5][5] in main
Now what I really want to do is that I want to copy values from one integer array to the v member of every object of this class above. Like:
int arr[5][5];
arr has integer values. I want to copy like this.
for(int i=0; i<5;i++)
for(int j=0;j<3;j++)*(*(block+i)+j).v=arr[i][j];
Quite surely this is not possible as my IDE states. It says "; Statement missing." and indicates towards the
*(*(block+i)+j).v=arr[i][j];
Also this is how I am initializing block though.
int V=5;
block = new cell*[V+1];
for(int x__=0; x__<=V; ++x__)
{
for(int y__=0; y__<=V; ++y__)
{
block[x__][y__].v=0 ;
}
}
Can anyone help me achieve this?
block[i][j].v = arr[i][j];