|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
#include<stdio.h>
void main()
{
int n,x,y,a[3][4]={0,1,2,3,4,5,6,7,8,9,10,11};
int (*p)[4];
p=a;
printf("please input x , y :\n");
scanf("%d %d",&x,&y);
printf("%d\n",*((*p+x)+y));
}
代码如上,为何第0行可以正常输出,第1 2行还是输出第0行的值
本帖最后由 claws0n 于 2018-8-13 18:32 编辑
- #include<stdio.h>
- void main()
- {
- int n, x, y;
- int a[3][4]={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
- int (*p)[4];
- p=a;
- printf("please input x , y :\n"); // x, y 是坐标吧?
- scanf("%d %d", &x, &y);
- printf("%d\n", *(*(p+x)+y) ); // 错误
- }
复制代码
可以加入适当的空格吗?看了会晕 
|
|