From: Timothy Hunter Date: 2006-08-28T05:30:00+09:00 Subject: Re: Defining a method with default arguments in C Brian Takita wrote: > Hello, > > How can I define a default argument value such as the following in c? > > def foobar(arg=1) > end > > Thanks, > Brian Takita > Specify the number of arguments as -1 in rb_define_method: rb_define_method(myclass, "method_name", meth_fnc, -1); In your method use rb_scan_args to scan the argument list. If you don't get enough arguments, use the default values instead.