// Define a pointer variable, which is similar to defining an integer variable. It also includes three parts: data type variable name = initial value
// Only the pointer variable is used to store the address.
// Int * pointer variable type, P pointer variable name, null pointer variable initial value.
// The role of INT: 1. When auto-increment is added, several bytes are added. 2. when data is accessed, several bytes are read at a time.
// When defining, * tells the compiler that the variable behind it is a pointer variable;
Int * P = NULL;
// Link
P = & A; // assign the address of A to P.
Printf ("% d \ n", a); // directly access the memory unit data
// * P is used to locate the corresponding memory unit based on the address of the pointer variable storage, and read the data from the memory unit.
Printf ("% d \ n", * P); // indirect access/indirect access to memory unit data
* P = 20;
Printf ("% d \ n", );
Printf ("% d \ n", * P );
// For pointer variable types, the size of the specified bucket is only related to the operating system. The 32-bit value is 4 bytes and the 64-bit value is 8 bytes.
Int * P1 = NULL;
//// If the initial value is null, point the pointer variable to an invalid space.
//// When you operate on the space indicated by P1, P1 must point to a valid space.
// P1 = & B;
// * P1 = 50;
// Printf ("% d \ n", * P1 );
// Int c = 30;
// P1 = & C;
//// The value of the pointer variable is re-assigned, which is called the pointer re-pointing. It only looks at the last point.
// Printf ("% d \ n", * P1 );
// Incompatible pointer types assigning to 'int *'
// The incompatible type does not match ....
// Thread 1: exc_bad_access (code = 1, address = 0x0)
// It does not point to a valid space. Crash crash
// Pointer and array
//
// Int A [5] = {10, 11, 12, 13, 14 };
//
// Int * P = NULL;
/// Point P to the first address of the array (array name a represents the first address of the array, representing the address of the first element in the array ).
// P = ;//
/// Printf ("% d \ n", * P );
/// P ++;
// For (INT I = 0; I <5; I ++ ){
// Printf ("% d", * (p + I); // printf ("% d", * (a + I ));
//}
// Printf ("\ n ");
/// When the first address of the array is assigned to the pointer Variable P, the pointer variable can be used as an array name.
//// The array name is a constant and cannot be changed.
// Pointer array. (each element in the array is a pointer variable ).
Char STR [] = "Frank ";
// Character array STR needs to store characters, so copy the content of the frank string in the constant area to the array. operations through the array are the content of the stack area.
// For array A, each element in the array is a balanced pointer variable. The pointer variable is used to store the address, so Frank, duck, the starting address of the iPhone is copied to the corresponding variable and the content of the constant zone is operated through the pointer operation.
Char * A [3] = {"Frank", "Duck", "iPhone "};
/// The content of the constant area cannot be changed.