using namespace std;
int _tmain(int argc, _TCHAR* argv)
but i cannot understand how it work.
No, he's not. He's creating an array of arrays of pointers.
and trying to output the size, this is not allowed sice the compiler does not know what the pointer is pointing to.
Yes, it's allowed and yes, the compiler knows perfectly well what p (or rather the pointer that p decays to) is pointing to: to a 20 element arrays of int pointers. So it returns sizeof(int*) * 20
And if he had created a pointer to an array (by writing int (*p) instead of int *p), it'd still be allowed and the compiler would still know what p points to: a 10x20 array of int. So in that case it would return sizeof(int) * 200.
I'm sorry, I do not understand your reply. I said that "in that case it [i.e. sizeof(*p)] would return sizeof(int) * 200". So yes, that's the same as sizeof(*p) (if p had been defined as a pointer to an array) - that's what I was saying.