C 基础
## 指针
### 值传递
> 不影响变量本身
### 地址传递
> 影响变量本身
###引用传递
> 影响变量本身
```C#includeint main(){
int a[]={1, 2, 3, 4, 5};
int *p;
p=a;
int i=0;
for(i=0;i<5;i++){
printf("%d\t",a[i]);
}
putchar('\n');
for(i=0;i<5;i++){
printf("%d\t",p[i]);
}
putchar('\n');
for(i=0;i<5;i++){
printf("%d\t",*(p+i));
}
putchar('\n');
for(i=0;i<5;i++){
printf("%d\t",*(a+i));
}
putchar('\n');
for(i=0;i<5;i++){
printf("%d\t",*p);
p++;
}
for(i+0;i<5;i++,p++){
printf("%d\t",*p);
}
putchar('\n');
}
```
```C#includevoid fun1(int x){
int i=2;
printf("%d\n",i+x);
}
void fun2(int x){
int i=2;
printf("%d\n",i*x);
}
void fun3(int x){
int i=3;
printf("%d\n",i%x);
}
typedef void (*Funtype)(int);
void CallMyFun(Funtype fp,int x){
fp(x);
}
int main(){
CallMyFun(fun1,3);
CallMyFun(fun2,5);
CallMyFun(fun3,7);
return 0;
}
```
WARNING: No any other purpose,keeping reminded! So sorry to offended,if necessary, contact me and I do change what I had done to protect your privileges!