呼叫按值,结果呢? [英] call-by-value-result?

查看:130
本文介绍了呼叫按值,结果呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有像什么'调用 - 值结果'C编程?
如果它存在,之间有什么'调用 - 值和呼叫按值,结果有什么区别?
或者两者都是一样的吗?


解决方案

  

调用 - 值结果定义


  
  

这是参数传递约定的地方
  实际参数是一个变量V
  其值被复制到本地
  变量L被调用的函数
  或程序。如果程序
  修改L,这些变化不会
  影响V时,还可以是在范围
  在过程中,直到
  程序返回时的最终值
  升被复制到五下
  呼叫通过引用变为L会
  立即生效诉用于
  例如,由英国广播公司BASIC v在橡子
  阿基米德。


来源: http://dictionary.reference.com/browse/call-通过值,结果

由于奥利说,C集成的呼叫按值行为。

Is there anything like 'call-by-value result' in c programming? If it exists , what is the difference between 'call-by-value' and 'call-by-value-result'? Or both are same?

解决方案

call-by-value-result definition

An argument passing convention where the actual argument is a variable V whose value is copied to a local variable L inside the called function or procedure. If the procedure modifies L, these changes will not affect V, which may also be in scope inside the procedure, until the procedure returns when the final value of L is copied to V. Under call-by-reference changes to L would affect V immediately. Used, for example, by BBC BASIC V on the Acorn Archimedes.

Source: http://dictionary.reference.com/browse/call-by-value-result

As Oli said, C incorporates call-by-value behaviour.

这篇关于呼叫按值,结果呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆