command
Version:
v0.2.5
Opens a new window with list of versions in this module.
Published: Dec 12, 2024
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
これは何?
cgoにてGo側で C.malloc()
を利用して、構造体のメモリを動的確保するサンプルです。
malloc()
には、確保するサイズを指定する必要がありますが、通常C言語側では
sizeof(struct A)
としますが、cgo側では以下のように構造体のサイズを取得することが出来ます。
var sz = C.sizeof_struct_(構造体)
typedefしていない構造体を扱う場合の宣言方法は 25.C_struct_not_typedef を参照ください。
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.