From: lalawawa Date: 2010-01-18T10:00:05+09:00 Subject: basic question: passing a modifiable argument to a routine Arguments to subroutines seem to be passed by value in ruby $ irb irb(main):001:0> def woof(a) irb(main):002:1> a += 2 irb(main):003:1> end => nil irb(main):004:0> b = 5 => 5 irb(main):005:0> woof(b) => 7 irb(main):006:0> b => 5 irb(main):007:0> so how do I pass a variable to a routine if I want the routine to modify the variable. In C I would say: void woof(int *a) { *a += 2; } int b = 5; woof(&b); printf("%d\n", b); would output 7.