Well, your codes are a little misleading. I don't quite understand what you are doing. Anyway, I'll go step by step with you. First, make sure you have this in mind:- A 10 block array like this [] [] [] [] [] [] [] [] [] []
for (int i=0; i<num_cells; i++)
a[i]=30*1+1;
cout<<"a:";
Here, I can only interpret one thing. The array will be filled with number 31 like this:- [31] [31] [31] [31] [31] [31] [31] [31] [31] [31]
But on screen you'll only see
a: as you didn't include the output into your loop
Then, I see that you transfer the array a to array b. Which I do not see the need for this. But please correct me if I'm wrong
for(i=0; i<num_cells; i++)
b [i] = a[i];
for (i=0; i<num_cells; i++)
cout << a [1]<<"";
If everything works well, you'll only get something like this
a [1]a [1]a [1]a [1]a [1]a [1]a [1]a [1]a [1]a [1]
The rest of the problem, I believe Dave had already mention them.