Skip to content

Instantly share code, notes, and snippets.

@kaneshin
Created March 19, 2015 09:20
Show Gist options
  • Select an option

  • Save kaneshin/af293d44dfbafbb19a28 to your computer and use it in GitHub Desktop.

Select an option

Save kaneshin/af293d44dfbafbb19a28 to your computer and use it in GitHub Desktop.
package main
/*
#import <stdio.h>
#import <stdlib.h>
static void
p(const char *c)
{
printf("%s\n", c);
}
*/
import "C"
import "unsafe"
func main() {
c := C.CString("Hello world")
defer C.free(unsafe.Pointer(c))
C.p(c)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment