正在加载图片...
指针作为函数参数 容易出现的错误一: #include<stdio. h> main i int a, b 2 void change(int *x, int *y) scanf(%d %d,, &a, &b) pI=&a; p2=&b; change(&a, &b) printfree 结果二:a=%d,b-%d7,a,b); printi(“结果三:*P1=%d,*P2=%d”,*P1,*P2)指针作为函数参数 • 容易出现的错误一: #include<stdio.h> main () { int a,b,*p1,*p2; void change(int *x,int *y) scanf(“%d %d”,&a,&b); p1=&a; p2=&b; change(&a,&b); printf(“结果二: a =%d,b=%d”,a,b); printf(“结果三: *P1= %d, *P2 =%d”,*P1,*P2); }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有