Added example of using multiple params
This commit is contained in:
@@ -2,6 +2,8 @@ defmodule MyLib do
|
|||||||
use FFI.Library, name: "libstdc++.so.6"
|
use FFI.Library, name: "libstdc++.so.6"
|
||||||
|
|
||||||
attach_function :puts, [:string], :int
|
attach_function :puts, [:string], :int
|
||||||
|
attach_function :printf, [:string, :int], :int
|
||||||
end
|
end
|
||||||
|
|
||||||
MyLib.puts("Hello World from C stdlib")
|
MyLib.puts("Hello World from C stdlib")
|
||||||
|
MyLib.printf("Random number: %d", :random.uniform(10))
|
||||||
|
|||||||
Reference in New Issue
Block a user