Here is the sample code that I ran on Visual Studio 2010:
#include <iostream>
int main()
{
int **p(NULL);
}
I get this error: error C2059: syntax error : 'constant'
But if I change int **p(NULL); to int **p = NULL; the above code compiles fine.
Checked this on GCC(Version:4.4.2) and both work fine. What am I missing here?
VC++ compiler seems confused about initializations of pointer to pointer …
This works for example
These don’t
This works though
etc… the pattern is initialization fails whenever two ** are present! I’d guess a bug! Someone from MSVC team might be able to confirm