Declare a reference for a two dimensional array without typecasting






4.67/5 (3 votes)
This not so useful tip tells you how to declare a reference for a two dimensional array without needing to use typecasting.
int x[1][20];
int (*p)[20] = x;
Here p
has become a reference to x
.
Usually in most cases, we use:
int** p = (int**) x;So, this tip gives you a hint about how to declare another reference for
x
without typecasting.