Skip to content

Instantly share code, notes, and snippets.

@hemanth
Created March 8, 2013 14:30
Show Gist options
  • Select an option

  • Save hemanth/5116791 to your computer and use it in GitHub Desktop.

Select an option

Save hemanth/5116791 to your computer and use it in GitHub Desktop.
inline C in ruby
require 'rubygems'
require 'inline'
class Say
inline(:C) do |builder|
builder.c 'void hello(char *name) {
printf("Hello %s!",name);
}'
end
end
Say.new.hello("world")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment