evaluation strategy examples

Posted by Boontz on Stack Overflow See other posts from Stack Overflow or by Boontz
Published on 2010-06-03T02:55:49Z Indexed on 2010/06/03 3:04 UTC
Read the original article Hit count: 226

Filed under:
|

Assuming the language supports these evaluation strategies, what would be the result for call by reference, call by name, and call by value?

void swap(int a; int b)
{
   int temp;
   temp = a;
   a = b;
   b = temp;
}

int i = 3;
int A[5];
A[3] = 4;
swap (i, A[3]);

© Stack Overflow or respective owner

Related posts about arrays

Related posts about learning