Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What does int (*ptr)[3] mean?
What does int (*ptr)[3] mean?
Hello, landlord. First of all, learning pointer has many confusing concepts. Let me help you distinguish:

1、int(* p)[3]; -ptr is a pointer variable (pointer) that points to a one-dimensional integer array with three elements.

2、int * p[3]; -Defines a pointer array p, which consists of three pointer elements pointing to integer data (it is an array).

3、int(*)[3]; -It's actually a data type. That is, the data type of p defined in the first (int(*p)[3]).

In fact, you have to see who he is, that is, who he combines with first. For example, in 1, p is first combined with *, indicating that p is essentially a pointer; The p in 2 is first combined with the following [3], which shows that it is essentially an array. Then slowly understand. I hope I can help you. You can ask me again if you have any questions.