作者QQ29 (我爱阿蓉)
看板C_and_CPP
标题Re: [课业] 97年高考三级资料结构题目编译无法成功...
时间Sat Apr 4 22:22:27 2009
大家好
请教一下
我测试一下发现观念不好 请各位帮忙厘清
int a[3][2] = {{10, 20}, {15, 25}, {50, 40}};
int (* intPtr3)[2] = &a[2]; //1. 该怎麽解释这个intPtr3是什麽东西呢??
cout<<intPtr3<<endl; //2.为什麽这两个数值会一样呢?
cout<<*intPtr3<<endl; 我认为*应该就会取到 [2][0]阿???
cout<<a[2]<<endl; //3.这两个值应该会不一样吧?
cout<<&a[2]<<endl; 但我印出来两个值是一样的 ...why??
cout<<**intPtr3<<endl; //4. 为什麽要取两颗心呢???
以上四个问题 有点疑惑
烦请各位给予指导
谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.113.207.211
1F:推 joefaq:intPtr3 指到的是 int[2] 所以要2个* 04/04 23:05