Skip to content

Instantly share code, notes, and snippets.

@karolmajta
Created January 6, 2014 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karolmajta/8289727 to your computer and use it in GitHub Desktop.
Save karolmajta/8289727 to your computer and use it in GitHub Desktop.
package main
// #include <stdio.h>
// #include <stdlib.h>
// #include <clp.h>
// int add(int x, int y) { return x + y; }
// int printInt(int x) { return printf("%d\n", x); }
import "C"
import (
"unsafe"
)
func main() {
var cs *C.char = C.CString("")
C.puts(cs)
C.printInt(C.add(1, 2))
C.free(unsafe.Pointer(cs))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment