正在加载图片...
Parameter passing Pass by value:This is the mechanism supportedby C.Value of parameters are copied into called routine. Pass by reference:No copying is done,but a reference(usually implemented as a pointer)is given to the value.In addition to allowing the called routine to change the values,it is also efficient means for passing large variables(such as structs). Pass by value-result:This interesting variant supported by languages such as Ada copies the value of the parameter into the routine,and then copies the (potentially changed) value back out.This has an effect similar to pass-by-reference,but not exactly. Pass by name:This rather unusual mechanism acts somewhat like C preprocessor macros and was introduced in Algol.Rather than evaluating the parameter value, the name or expression is actually substituted into the calling sequence and each access to the parameter in the calling body re-evaulates it. Parameter passing Pass by value: This is the mechanism supported by C . Value of parameters are copied into called routine. Pass by reference: No copying is done, but a reference (usually implemented as a pointer) is given to the value. In addition to allowing the called routine to change the values, it is also efficient means for passing large variables (such as structs). Pass by value-result: This interesting variant supported by languages such as Ada copies the value of the parameter into the routine, and then copies the (potentially changed) value back out. This has an effect similar to pass-by-reference, but not exactly. Pass by name: This rather unusual mechanism acts somewhat like C preprocessor macros and was introduced in Algol. Rather than evaluating the parameter value, the name or expression is actually substituted into the calling sequence and each access to the parameter in the calling body re-evaulates it
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有