Tomás wrote:
[snip]
However, the following won't compile:
unsigned (*p_numbers)[5] = new unsigned[5];
(*p_numbers)[0] = 5;
(*p_numbers)[1] = 6;
delete [] p_numbers;
My compiler gives me the following error:
cannot convert `unsigned int*' to `unsigned int (*)[5]'
[snippers]
Sure. What does int (*) suggest to you? Hint, look up
"pointer to function" and see what you find. Putting the
( ) round (*p_numbers) changes the type.
You need to read up on the syntax of what's going on here.
It looks like you've just guessed what it should be. Get
something like _The C++ Language_ and read the first
100 pages or so very carefully. Also, read through this
group and find the C++ FAQ and read it carefully.
Socks