diff --git a/examples/basic.exs b/examples/basic.exs index 18bd507..9cf5a32 100644 --- a/examples/basic.exs +++ b/examples/basic.exs @@ -2,6 +2,8 @@ defmodule MyLib do use FFI.Library, name: "libstdc++.so.6" attach_function :puts, [:string], :int + attach_function :printf, [:string, :int], :int end MyLib.puts("Hello World from C stdlib") +MyLib.printf("Random number: %d", :random.uniform(10))