A C calling convention defines how function arguments, return values, and calls are represented so compiled Rust and C functions can interoperate. Marking a Rust function with extern "C" selects this convention; exporting it also requires a C-compatible dynamic library and a stable symbol name. section 3.2.2
Exporting a Rust function for C
A calculator program declares solve and links against a Rust dynamic library. The Rust definition uses #[no_mangle] and extern "C", with raw C-compatible pointers and an integer return value. After Cargo builds the library, gcc can link the C program and call solve.
