作者deepdish (要和数学装熟..)
看板TransCSI
标题Re: [问题] 指标
时间Mon May 16 12:36:18 2005
※ 引述《fly2089 (.......... N )》之铭言:
: 请问一下...
: 什麽是 call by test??
: 我在做文化92年考古题看到的
: 我去问补习班老师....
: 他说没听过这个名词耶@@
用 google 找不到中文资料,找到一份投影片,请看第 62 张
http://www.wku.edu/~mostafa.mostafa/DS_site/DS_Ch1.ppt
1.5.2 Parameter Passing
Call by Test:(传测试呼叫)
Parameter value Needs to be changed?(如果值需要改变)
Yes
Call by reference
No
If the type is primitive type(如果是原型)
Yes Call by value
No If class type is small(如果类型比较小)
Yes Call by value
No Call by const reference
这篇解释应该已经很详细了
-
PS:如果上面有看不懂,请先看 61 张投影片
1.5.2 Parameter Passing
Call by value(传值呼叫)
The actual parameter is copied into the formal parameter
Small objects / no need to alter their values
Call by constant reference(传常数参考呼叫)
Don’t copy them, just tell me where I can reach them
but I do want to preserve their values Large objects
/ no need to alter their values
Call by reference(传参考呼叫)
Don’t copy them, just tell me where I can reach them
and allow me to alter their values Large or small objects
/ there is a need to alter their values
Example
double avg (const vector<int> & arr, int n, bool & errorFlag);
--
欢迎大家一起加入Intel Philanthropic Peer-to-Peer Program !!!
这项「英特尔慈善『点对点连线』计画」旨在经由网际网路,把数百万部个人电脑连结
起来,加速研发治疗白血球过多症(血癌)的药物,从而把新药上市的需要时间缩短约
一半。对本计画有兴趣者,可以到http://www.grid.org/download/gold/download.htm
网站,下载该程式。
一旦一批资料处理完毕,下次电脑连接上网际网路时,不论经由宽频或拨接,电脑便会
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.115.201.17