From: Haoqi Haoqi Date: 2007-05-01T16:13:26+09:00 Subject: sprintf can not work in ruby c source? here is my simple test: where is my mistake?? #include "ruby.h" #include "stdio.h" static VALUE tests(){ char *s1="a "; char *s2=" b"; char *buf; sprintf(buf,"%s after %s",s1,s2); printf(buf); return Qnil; } void Init_hello(){ rb_define_global_function("tests",tests,0); } -- Posted via http://www.ruby-forum.com/.