Crystal Expert · Lesson 7

C bindings: lib, fun, structs, out parameters and callbacks

Call C functions directly: declare them in a lib block, pass strings and buffers, return C structs, use out parameters and hand a callback to qsort.

Lessons · Crystal Expert · Lesson 7 of 10

C bindings: lib, fun, structs, out parameters and callbacks

Call C functions directly: declare them in a lib block, pass strings and buffers, return C structs, use out parameters and hand a callback to qsort.

Illustration for Crystal
Call C functions directly: declare them in a lib block, pass strings and buffers, return C structs, use out parameters and hand a callback to qsort.