第十五周上机项目2--(2) 阅读程序
2014-12-03 22:44
246 查看
/* *Copyright (c) 2014,烟台大学计算机学院 *All rights reserved . *文件名称:test .cpp *作 者:曹莉萍 *完成日期:2014 年12月3日 *版 本 号:v1.0 * */ #include <iostream> using namespace std; int *p; void pp(int a,int*b); int main() { int a=1,b=2,c=3; p=&b; pp(a+c,&b); cout<<"(2)"<<a<<","<<b<<","<<*p<<endl; return 0; } void pp(int a,int *b) { int c=4; *p=*b+c; a=*p-c; cout<<"(1)"<<a<<","<<*b<<","<<*p<<endl; }
运行结果
<img src="http://img.blog.csdn.net/20141203224712281" alt="" />
相关文章推荐
- 第十五周上机实践项目1(3):阅读程序
- 第十五周上机实践项目1(6):阅读程序
- 第十五周上机实践项目1(2):阅读程序
- 第十五周上机实践项目1(5):阅读程序
- 第十五周上机实践项目1(4):阅读程序
- 第十五周上机项目2--(1)阅读程序
- 第12周上机实践项目1——阅读程序(递归函数)
- 第十五周项目二-阅读程序(1)
- 第十二周上机项目1 阅读程序(5)
- 第十五周项目二 阅读程序
- 第十五周 项目二:阅读程序(2.2)
- 第十五周项目 2 阅读程序(1)
- 第12周上机实践项目1——阅读程序(全局变量)
- 第十五周 项目二:阅读程序
- 第十五周项目2(2)阅读程序
- 第十五周项目2阅读程序
- 第十二周上机项目1 阅读程序(3)
- 第十二周上机项目1 阅读程序(2)
- 第15周上机实践项目2——阅读程序(1)
- 第15周上机实践项目2——阅读程序(2)