您的位置:首页 > 其它

第十六周项目二(2) 阅读指针程序

2014-12-09 12:49 239 查看
问题及代码

/*
*ALL rights reserved.
*文件名称:shiliuzhouxiang2-2
*作者:李长鸿
*完成时间:2014.12.09
*问题描述:指针程序阅读
*/
#include<iostream>
using namespace std;
int *p;
void pp(int a,int *b)
{
int c=4;
*p=*b+c;
a=*p-c;
cout<<"(1)"<<a<<","<<*b<<","<<*p<<endl;
}
int main()
{
int a=1,b=2,c=3;
p=&b;
pp(a+c,p);
cout<<"(2)"<<a<<","<<b<<","<<*p<<endl;
return 0;
}




总结:我的结果是2,2,6。 1,2,6, 百思不得其解
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: