Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用 Go 的“外部函数接口”调用 C 函数?
FAQ中提到了这个接口,但我在文档的其他地方看不到它。
Check out this file from the Go repository. It shows how to wrap a C library in Go and has quite a few comments that explain the process.
这是一篇使用Cgo演示以下内容的文章:
举个例子,这是一个 Go 包,它提供了两个函数 -Random并且Seed- 包装了 Crand和srand函数。
Random
Seed
rand
srand