Function show_notes::e029::ffi::translate
source · pub(super) unsafe extern "C" fn translate(
point: *mut Point,
by_x: c_float,
by_y: c_float,
)
Expand description
An example of a C function we can call with an object.
You can use it in an unsafe
block like so:
ⓘ
let mut point = Point { x: 0.0, y: 0.0 };
unsafe {
translate(&mut point, 12.3, 14.4);
}
assert_eq!(point, Point { x: 12.3, y: 14.4 });