码迷,mamicode.com
首页 > 其他好文 > 详细

指针的指针

时间:2015-07-01 09:54:33      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:

示例

 1 #include <iostream>
 2 using namespace std;
 3 int main()
 4 {
 5     int a = 35;
 6     int *b1 = &a;
 7     int **b2 = &b1;
 8     cout << a << "    "<< *b1 << "     "<< **b2 << "     "<< endl;
 9     return 0;
10 }

结果:35   35    35

示例2

#include <iostream>
using namespace std;
int main()
{
    int a = 35;
    int *b1 = &a;
    int **b2 = &b1;
    cout << a << "    "<< b1 << "     "<< *b2 << "     "<< endl;
    return 0;
}

结果:35   002FFC84   002FFC84

示例3

#include <iostream>
using namespace std;
int main()
{
    int a = 35;
    int *b1 = &a;
    int **b2 = &b1;
    cout << a << "    "<< b1 << "     "<< b2 << "     "<< endl;
    return 0;
}

结果:35   0035F7F0   0035F7E4

指针的指针

标签:

原文地址:http://www.cnblogs.com/table/p/4612322.html

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