H
Haoqi Haoqi
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);
}
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);
}