Unfortunately, a type system will not help you here.
x [0] and x [1] are both int * types, so you can do
*(x[0]) = 1; // allowed *(x[1]) = 2; // access violation, not through x[1] itself but by accessing it
Of course your intention was
(*x)[0] = 1; (*x)[1] = 2;
Cashcow
source share