早教吧 育儿知识 作业答案 考试题库 百科 知识分享

算法导论算法导论英文版第二章2.1节关于伪代码的第八条我看的不是很懂敢问那位大侠翻译并解释一下以下是原文“Parametersarepassedtoaprocedurebyvalue:thecalledprocedurereceivesitsowncopy

题目详情
算法导论
算法导论 英文版 第二章 2.1节关于伪代码的第八条 我看的不是很懂 敢问那位大侠翻译并解释一下 以下是原文
“Parameters are passed to a procedure by value:the called procedure receives its own copy of the parameters,and if it assigns a value to a parameter,the change is not seen by the calling procedure.When objects are passed,the pointer to the data representing the object is copied,but the object's fields are not.For example,if x is a parameter of a called procedure,the assignment x ← y within the called procedure is not visible to the calling procedure.The assignment f [x] ← 3,however,is visible.”
▼优质解答
答案和解析
在一个过程中,参数通过值来传递:调用过程收到它自己其中的参数,如果参数被赋上一个值,这个变化对调用过程是不可见的.当对象被传递的时候,数据的指针代表了对象被复制,但是对象域却没有.例如,如果x是一个调用过程的...
看了算法导论算法导论英文版第二章2...的网友还看了以下: