Topic: How to get all arguments pased in printf format from ruby in C program

I have implemented Ruby C extension(i.e. Invoking C function from ruby script) Following is the variable argument function implemented in C from file "cImplementation.c"

#include<stdio.h>
static VALUE cFunction(VALUE self, const char* fmt, ...)
{
     return Qnil;
}
void Init_MyRuby()
{
      VALUE MRuby = rb_define_module("MyRuby");
     rb_define_singleton_method(MRuby, "cFunction", cFunction, 1);
}

Following is the code of ruby script that invokes cFuncton() method by pssing printf  formated string as below:

require 'cFile'
MyRuby::cFunction("My Message:: %s, My Value:: %d", "Hi Im here", 100 )

Can any one suggest me how to access this printf formated string in C functon so that value should be printed as per access specifier? e.g.output in C function expected like=> My Message:: Hi Im here, My Value:: 100 Thanks in advance.

Re: How to get all arguments pased in printf format from ruby in C program

That's a tricky one,  not sure it's doable,  as the variable types after the format are unknown

But why bother,  Ruby already has sprintf built in?????

In Ruby:

str = sprintf("My Message:: %s, My Value:: %d", "Hi Im here", 100 )
Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.