csharp-version-history#c-version-72 https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/ref-struct
安装 node-ffi通过Buffer类,在C代码和JS代码之间实现了内存共享,类型转换则是通过ref、ref-array、ref-struct实现。 npm install -g node-gyp 根据需要安装对应的库 npm install ffi npm install ref npm install ref-array npm install ref-struct const CName = refArray(refArray(ref.types.char, 100), 50) const cName = new CName() 结构体 结构体是C中常用的类型,需要用到ref-struct typedef struct { Class class[4]; } Grade; JS const ref = require('ref') const Struct = require('ref-struct