From: Tim Becker Date: 2007-03-14T22:38:12+09:00 Subject: Re: A simple question regarding ruby method argument > If I have a method which will need to modify the parameter passing to > it, how do I going to do that in ruby? Maybe you could post the source of the method so we can figure out how to get around the problems you're experiencing. > In c we can pass in reference But if you pass in a pointer in C and assign a new value to the pointer itself (instead of changing what is being pointed at) you won't change the pointer variable outside of method scope either... In c: #include void test( int * x) { x=0; // modifies the reference, doesn't have the intended effect } void test2 (int * x) { *x=0; // modifies the referenced values, works. } int main (int argc, char * argv[]) { int i=1; printf("%d\n", i); test (&i); printf("%d\n", i); test2 (&i); printf("%d\n", i); } -Tim