Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / C

Declare a reference for a two dimensional array without typecasting

4.67/5 (3 votes)
25 Dec 2011CPOL 33.3K  
This not so useful tip tells you how to declare a reference for a two dimensional array without needing to use typecasting.
C#
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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)