Why are you treating int, int*, and int** as if they are classes? I think maybe it doesn't like that in the case of an int** and it's giving you an odd error because this was never expected.
Why are you treating int, int*, and int** as if they are classes?
I was calling the constructor of each instance of int. This is not illegal. It is illegal to initialize a pointer-to-a-pointer using the constructor( I know that now ).
...and it's giving you an odd error because this was never expected
Compiler errors are generally given when coders make errors, which are unexpected to compilers.
@ Dish - Thats what I thought at first.
So I tested it like this:
1 2 3
int (**Pointer)(&Target);//
Pointer = &Target; //
It compiled and the The second line didn't crash and burn as it would have done if
it was a function pointer
and cout << Target << " " << *Pointer << endl; gave the same values.
I still can't quite understand why int **Pointer( &Target ); doesn't work -
but I assume the ** coupled with the () constructor throws the normal compiler
parsing as it probably expects a single type - putting the (**) gets rid of any ambiguity.
DISCLAIMER
The above explaination is pure guesswork.
I did that in MSVC - I'll see what MINGW does.