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. hdu 1806 rmq

    找到一个区间内出现最多的数的次数 10 3 //10个数字三次询问 -1 -1 1 1 1 1 3 10 10 10 2 3 1 10 5 10 0 143 #include<cstdio> ...

  2. Harris角点

    1. 不同类型的角点 在现实世界中,角点对应于物体的拐角,道路的十字路口.丁字路口等.从图像分析的角度来定义角点可以有以下两种定义: 角点可以是两个边缘的角点: 角点是邻域内具有两个主方向的特征点: ...

  3. maven打的jars项目,log4j不会输出日志

    通过maven打完包,运行jars时,会输出警告 log4j:WARN No appenders could be found for logger (com.dlht.DataCenterSYNC. ...

  4. 关于LR中的EXTRARES

    LoadRunner脚本之EXTRARES参数 EXTRARES:分隔符,表示标记下一个属性是资源属性的列表(list of resource attributes). [EXTRARES后的资源是由 ...

  5. 编译fdk-aac for ios

    Build all: build-fdk-aac.sh Build for some architectures: build-fdk-aac.sh armv7s x86_64 Build unive ...

  6. 2016.7.8 计算机网络复习要点第四章之地址解析协议ARP

    1.地址解析协议ARP:知道一个机器的IP地址,需要找到其相应的硬件地址:ARP协议的用途是为了从网络层使用的IP地址解析出在链路层使用的硬件地址: 2.由于是IP协议使用了ARP协议,因此通常就把A ...

  7. Windows内核下操作字符串!

    * Windows内核下操作字符串! */ #include <ntddk.h> #include <ntstrsafe.h> #define BUFFER_SIZE 1024 ...

  8. 打包apk

    apk 配置环境变量 打开"终端",输入"pico .bash_profile"命令 export ANDROID_SDK_ROOT=/Users/sun/Do ...

  9. Windows Phone 硬件检测

    private static bool IsWvga{ get { return App.Current.Host.Content.ScaleFactor == 100; }} private sta ...

  10. <!--[if IE]>….<![endif]--> (<!--[if !IE]>||<![endif]-->)的用法

    1. <!--[if !IE]><!--> 除IE外都可识别 <!--<![endif]--> 2. <!--[if IE]> 所有的IE可识别 ...