View Single Post
Old 11-03-2004, 11:37 AM   #1 (permalink)
LauraP
 
Newb Techie

Join Date: Oct 2004

Posts: 14

LauraP

Default Parameter passing methods problem

Could someone help me with this. Passed by value would be the result i get from actually running this program right? But I am confused about the passed by reference. Can anyone solve this and explain how you got your answers. Thanks


void foo(int x, int y)
{
i = y;
y += 3;
}

void main()
{
i = 2;
j = 3;
foo(i, j);
printf("%d %d\n", i, j);
}

what would the output be if you:
passed by value:
passed by reference:
and passed by value-result:

thanks
LauraP is offline