码迷,mamicode.com
首页 > 编程语言 > 详细

数组指针(二维数组的指针)

时间:2016-04-26 09:34:42      阅读:209      评论:0      收藏:0      [点我收藏+]

标签:

技术分享
 1 #include <iostream>
 2 
 3 using namespace std;
 4 
 5 
 6 int main()
 7 {
 8     int v[2][2]={{1,2},{3,4}};
 9     cout<<"v = "<<v<<endl;
10     cout<<"*v = "<<*v<<" &v = "<<&v<<endl;
11     cout<<"*v+1 = "<<*v+1<<endl;
12     cout<<"*(v+1) = "<<*(v+1)<<" &v[1] = "<<  &v[1]<<endl;
13     cout<<"v[0] = "<<v[0]<<" &v[0] = "<<  &v[0]<<endl;
14     cout<<endl;
15 
16     cout<<"**v = "<<**v<<endl;
17     cout<<"**(v+1) = "<<**(v+1)<<endl;
18     cout<<"*(*v+1) = "<<*(*v+1)<<endl;
19     cout<<"*(v[0]+1) = "<<*(v[0]+1)<<endl;
20     cout<<"*(v[1]) = "<<*(v[1])<<endl;
21 
22     return 0;
23 }
技术分享

数组指针(二维数组的指针)

标签:

原文地址:http://www.cnblogs.com/shouce/p/5433628.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!