10 2017 档案

指针赋值
摘要:#include<stdio.h>int main(){ int a=1; int *b; b=&a; return 0;} 若将b=&a改为*b=a,运行时将会出现错误。下面是几种对指针变量b的赋值: p=&a; p=NULL; p=0; p=(int *)1732; 阅读全文

posted @ 2017-10-31 22:50 balance_uit 阅读(200) 评论(0) 推荐(0)

通过指针修改值
摘要:#include<stdio.h>void numberC(int a,int b){ int c; c=a; a=b; b=c;}void addressC(int *c,int *d){ int *a; a=c; c=d; d=a;}void towardC(int *c,int *d){ in 阅读全文

posted @ 2017-10-31 22:41 balance_uit 阅读(853) 评论(0) 推荐(0)

指针作为函数的返回值
摘要:不能在实现函数返回在函数内部定义的局部数据对象的地址, 这是因为所有的局部数据对象在函数返回时就会消忙,其值不在有效。 #include<stdio.h> char *match(char *s,char ch);int main(){ char ch,str[80],*p=NULL; printf 阅读全文

posted @ 2017-10-20 20:35 balance_uit 阅读(1006) 评论(0) 推荐(0)