2 ms·
As mentioned, I don't particularly like C, so I've explored Rust a bit. I tried to expose a Rust function to C, heres the signature: #[no_mangle] pub exter
by MrBuddyCasino 10y ago
As mentioned, I don't particularly like C, so I've explored Rust a bit. I tried to expose a Rust function to C, heres the signature:
#[no_mangle]
pub extern "C" fn count_substrings(value: *const c_char, substr: *const c_char) -> i32
So I came at it from the opposite direction, and once you go down the rabbit hole of what "no_mangle" and "extern C" does, thats where it leads you.
Along the way you inevitably pick up topics like alignment and struct packing.