第十六周项目二(2) 阅读指针程序
2014-12-09 12:49
239 查看
问题及代码
总结:我的结果是2,2,6。 1,2,6, 百思不得其解
/* *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, 百思不得其解
相关文章推荐
- 第十六周项目二(1) 阅读程序
- 第九周项目:阅读程序 类和指针
- 第十六周项目 阅读程序(1)
- 第十六周项目 阅读程序(9)
- 第十六周项目 阅读程序(5)
- 第5周项目--程序阅读——指针、const、static
- 第十六周项目一 d阅读程序(2)
- 第十六周项目 阅读程序(2)
- 第十六周实践项目之阅读程序————1
- 第十六周项目 阅读程序(8)
- 第十六周项目一----阅读程序
- 第十六周上机项目阅读程序二
- 第十六周项目一 a阅读程序(3)
- 第十六周项目 阅读程序(3)
- 第十五周项目2-程序阅读(对指针的理解2)
- 第九周项目:程序阅读 类和指针
- 第十六周项目一 b阅读程序(2)
- 第十六周项目一 c阅读程序
- 第十六周项目 阅读程序(6)
- 第十六周项目 阅读程序(4)