由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - one more interview question
相关主题
Default function template argumentshow to proof (转载)
ajax小问题question about using Hive parameter (转载)
static如何作为函数?如果python command line positional arguments 里有些是运算,那这种argument 该怎么处理?
Question: How to store initialize arguments?一个哈希表问题
问一个C++问题:default parameter and overriding/inheritanc (转载)Check if the sum of two integers in an integer array eqauls to the given number
FP的可读性是最大问题面试题 -算法?
C -- sample without replacement两道M软件大公司的最新面世算法题 (转载)
how to write a function take iterators as parameters?template metaprogramming 的问题
相关话题的讨论汇总
话题: procedure话题: value话题: name话题: question话题: interview
进入Programming版参与讨论
1 (共1页)
m*******o
发帖数: 264
1
Write a simple procedure or function that will have four different effects,
depending on whether arguments are passed by value, by reference, by value/
result, or by name in whatever language you like.
m******t
发帖数: 4077
2
what does it mean by passing by name?

,

【在 m*******o 的大作中提到】
: Write a simple procedure or function that will have four different effects,
: depending on whether arguments are passed by value, by reference, by value/
: result, or by name in whatever language you like.

m*******o
发帖数: 264
3
Passed by name: the effect of a procedure call is as if the call were
replaced by the body of the procedure with the formal parameter names
replaced by the actual parameter names. eg.
integer procedure Sum(Exp, i, low, high)
integer Exp, i, low, high;
begin
integer s;
s:=0
for i:=low to high do
s:=s+Exp
return s;
end
Sum(A[j], j, 1, 10) ------> passed by name: s:=s+A[j]
m******t
发帖数: 4077
4
is this available in c/c++?

【在 m*******o 的大作中提到】
: Passed by name: the effect of a procedure call is as if the call were
: replaced by the body of the procedure with the formal parameter names
: replaced by the actual parameter names. eg.
: integer procedure Sum(Exp, i, low, high)
: integer Exp, i, low, high;
: begin
: integer s;
: s:=0
: for i:=low to high do
: s:=s+Exp

m*******o
发帖数: 264
5
not sure, just a interview question I got!
c********x
发帖数: 84
6
by value, - pass in parameter
by reference, - pass in referece
by value/
result, -return a result
by name -pass in an alias
1 (共1页)
进入Programming版参与讨论
相关主题
template metaprogramming 的问题问一个C++问题:default parameter and overriding/inheritanc (转载)
difference between: char** p and char*p[] ??FP的可读性是最大问题
请问call by name是不是C编译器都没实现C -- sample without replacement
Any difference between class and typename identifier?how to write a function take iterators as parameters?
Default function template argumentshow to proof (转载)
ajax小问题question about using Hive parameter (转载)
static如何作为函数?如果python command line positional arguments 里有些是运算,那这种argument 该怎么处理?
Question: How to store initialize arguments?一个哈希表问题
相关话题的讨论汇总
话题: procedure话题: value话题: name话题: question话题: interview