一 指针
1. 指针的声明
int *p // 此时的p是一个int型的指针
int *p = 0;// WA,because the p haven't be allocate the space
int *p,p1;// you must be attention that the p1 is the type of int,because the * only declocate the p
2. 通过指针的赋值
int *p = &a;
*p = 1;
// through this way can we change the value of the a
*p++ // this ++ is made the to the p
(*p)++ // this ++ is made to the a
3 const 与 指针
* or const 都只是修饰的符号,如const int 修饰的是int ,int *const修饰的是后面的那个
const int a = 1; // in this way the a must be initlize and it can not be changed
const int *p = &a; // OK, the const int type point can point to the
int *p = &a; // WA, because the int* cannot point to the const int
const int* const p2 = &a;// if we use the const to declocate the point,the point only point this value
我们可以用指向const int型的指针去指向一个int型的数字,但是这个int型的数是不难被这个改变的
int b;
const int* p3 = &b;
二 类型别名
我们通常使用typedef去处理我们的变量的别名
take something for example
typedef long long ll
// in this way the ll is the nickname of the long long ,and it is equal to the #define ll long long
三 Auto类型
auto i = 0,*p = &i;
// if we use the auto to declare the varible, we do not need to worry about the type
四 decltype 类型
使用decltype类型去处理数据的时候,我们可以通过decltype(x) to get the type of the x
decltype(x) c = 0;
// the c is the same type of the x