Very simple, how can I do the same thing I would do in C in Rust.
So C code:
extern mps_res_t mps_arena_create_k(mps_arena_t *);
mps_arena_t arena;
res = mps_arena_create_k(&arena);
In C this works, so in rust I did:
extern "C" {
pub fn mps_arena_create_k(arg1: *mut mps_arena_t) -> mps_res_t;
} // created by rust_bindgen
unsafe {
let mut arena : *mut mps_arena_t;
res = mps_arena_create_k(arena);
}
The problem is that the compiler complains:
error: use of possibly uninitialized variable: `arena`
Im not a good C programmer but this pattern seams common, how do I do it in rust?