Created
January 6, 2014 20:58
-
-
Save karolmajta/8289727 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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