Is there any difference between
const int* ptr[5];
and
const int (*ptr)[5];
?
I am trying to point to a const 5*5 2D int array, but I am not sure of the best way to do it
const int* ptr[5];
This is an array of five elements, each element is a pointer to const int
.
const int (*ptr)[5];
This is a pointer to an array of five elements, each element is a const int
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.