Pointer type and pointer type description 2010-03-17 1774 people read comments (1) collect reports compiler C
1. pointer type
From the perspective of syntax, you only need to remove the pointer name in the pointer declaration statement, and the remaining parts
This is the pointer type. This is the type of the pointer. Let's take a look
Pointer types:
(1) int * PTR; // the pointer type is int *
(2) char * PTR; // the pointer type is char *
(3) int ** PTR; // the pointer type is int **
(4) int (* PTR) [3]; // the pointer type is int (*) [3]
(5) int * (* PTR) [4]; // the pointer type is int * (*) [4]
How is it? Is it easy to find the pointer type?
2. Type pointed to by pointer
When you access the memory area pointed to by the pointer, the type pointed to by the pointer determines
The compiler treats the content in the memory area as something.
In terms of syntax, you only need to declare the pointer name and the pointer sound on the left of the name in the pointer declaration statement.
The identifier * is removed, and the rest is the type pointed to by the pointer. For example:
(1) int * PTR; // The Pointer Points to an int type.
(2) char * PTR; // The Pointer Points to a char type.
(3) int ** PTR; // The type pointed to by the pointer is int *
(4) int (* PTR) [3]; // The type pointed to by the pointer is int () [3]
(5) int * (* PTR) [4]; // The type pointed to by the pointer is int * () [4]
In pointer arithmetic operations, the type pointed to by the pointer has a great effect.
The pointer type (the pointer type) and the pointer type are two concepts. When you
When you are getting familiar with C, you will find that the concept of "type" mixed with pointers is divided
The concepts of "pointer type" and "pointer type" are one of the key points to be proficient in pointers.
I read a lot of books and found that some poorly written books bring together the two concepts of pointers,
As a result, the conflicts between books become increasingly confusing.
Source: http://blog.csdn.net/gwonph/article/details/5389397>
From Weizhi note (wiz)