Skip to content

Instantly share code, notes, and snippets.

View akamensky's full-sized avatar
💻
coding for fun

Alexey Kamenskiy akamensky

💻
coding for fun
View GitHub Profile
@akamensky
akamensky / README.md
Last active March 27, 2018 18:01
Passing arrays of structs between Go and C
  1. Put cinterface.go, cinterface.c and test.h in ~/go/src/cinterface/
  2. Then call go build -buildmode=c-archive cinterface, this will produce cinterface.a and cinterface.h in current directory
  3. Put main.c and test.h in current directory and call gcc -o main -I. cinterface.a main.c, this will produce final binary