Computer Science An Overview _J. Glenn Brookshear _11th Edition_C

Note that passing parameters by value protects the data in the calling unit from being mistakenly altered by a poorly designed procedure. For example, if the calling unit passed an employee’s name to a procedure, it might not want the procedure to change that name.

Unfortunately, passing parameters by value is inefficient when the parameters represent large blocks of data. A more efficient technique is to give the procedure direct access to the actual parameters by telling it the addresses of the actual parameters in the calling program unit. In this case we say that the parameters are passed by reference. Note that passing parameters by reference allows the procedure to modify the data residing in the calling environment. Such an approach would be desirable in the case of a procedure for sorting a list.

The task of transferring data between actual and formal parameters is handled in a variety of ways by different programming languages. In some languages a duplicate of the data represented by the actual parameters is produced and given to the procedure. Using this approach, any alterations to the data made by the procedure are reflected only in the duplicate—the data in the calling program unit are never changed. We often say that such parameters are passed by value.

a duplicate of the data // 副本

passing parameters by value is inefficient when the parameters represent large blocks of data的更多相关文章

  1. [Angular2 Router] Optional Route Query Parameters - The queryParams Directive and the Query Parameters Observable

    In this tutorial we are going to learn how to use the Angular 2 router to pass optional query parame ...

  2. DataGridView控件

    DataGridView控件 DataGridView是用于Windows Froms 2.0的新网格控件.它可以取代先前版本中DataGrid控件,它易于使用并高度可定制,支持很多我们的用户需要的特 ...

  3. DataGridView控件-[引用]

    DataGridView控件 DataGridView是用于Windows Froms 2.0的新网格控件.它可以取代先前版本中DataGrid控件,它易于使用并高度可定制,支持很多我们的用户需要的特 ...

  4. DataGridView控件使用大全说明-各种常用操作与高级操作

    DataGridView控件 DataGridView是用于Windows Froms 2.0的新网格控件.它可以取代先前版本中DataGrid控件,它易于使用并高度可定制,支持很多我们的用户需要的特 ...

  5. DataGridView控件使用大全

    转自:http://www.cnblogs.com/xiaofengfeng/archive/2011/04/16/2018504.html DataGridView控件 DataGridView是用 ...

  6. Internet protocol optimizer

    A method for optimizing the throughput of TCP/IP applications by aggregating user application data a ...

  7. Understanding transient variables in Java and how they are practically used in HashMap---reference

    What is the significance of the transient keyword in Java? If you know the answer, good! you are a p ...

  8. 【Professional English】Words Summary

    01.数据库管理系统(Database Management Systems,DBMS) A database management system (DBMS) is a computer softw ...

  9. NVIDIA---CUDA

    http://en.wikipedia.org/wiki/CUDA CUDA From Wikipedia, the free encyclopedia     CUDA Developer(s) N ...

随机推荐

  1. struts2框架——从后台取得数据集,并在前台页面循环显示

    1.CourseBean.java public class CourseBean { private String f_courseId = ""; private String ...

  2. 【HTML5】特性

    HTML5 建立的一些规则: 新特性应该基于 HTML.CSS.DOM 以及 JavaScript. 减少对外部插件的需求(比如 Flash) 更优秀的错误处理 更多取代脚本的标记 HTML5 应该独 ...

  3. hdu 1269 迷宫城堡 强连通分量

    迷宫城堡 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submis ...

  4. js:数据结构笔记6--字典

    Dictionary类的基础是数组不是对象:字典的主要用途是通过键取值: 基本定义: function Dictionary() { this.dataStore = new Array(); thi ...

  5. QUnit使用笔记-4保持原子性与分组

    原子性: 当将许多测试用例放到一起测试的时候,可能会因为相互的副作用而出错:这个时候应该尽可能将他们分别放到test()中测试: 对应测试到Dom,应该尽可能地使用#qunit-fixture,因为它 ...

  6. 计算几何 2013年山东省赛 A Rescue The Princess

    题目传送门 /* 已知一向量为(x , y) 则将它旋转θ后的坐标为(x*cosθ- y * sinθ , y*cosθ + x * sinθ) 应用到本题,x变为(xb - xa), y变为(yb ...

  7. python+pygame游戏开发之使用Py2exe打包游戏

    最近在用python+pygame 开发游戏,写完以后在分享给朋友玩的时候遇到了很大的问题,只有搭建了环境才能运行python脚本. 这会吓退99%以上的人……所以把我们的游戏打包(注意是打包而不是编 ...

  8. Piggy-Bank[HDU1114]

    Piggy-Bank Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total ...

  9. 数据库操作sql【转】

    Student(S#,Sname,Sage,Ssex) 学生表Course(C#,Cname,T#) 课程表SC(S#,C#,score) 成绩表Teacher(T#,Tname) 教师表 问题:1. ...

  10. 使用CSS修改HTML5 input placeholder颜色

    HTML <input type="text" placeholder="Value" /> 有三种实现方式:伪元素(pseudo-elements ...