call-by-value-result?

前端 未结 2 368
清歌不尽
清歌不尽 2021-01-06 04:45

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 s

相关标签:
2条回答
  • 2021-01-06 05:02

    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.

    0 讨论(0)
  • 2021-01-06 05:21

    Not really. C is effectively call-by-value. If you want different behaviour, you'll have to emulate it manually.

    0 讨论(0)
提交回复
热议问题