Function nc::c_str::strlen

source ·
pub fn strlen(buf: usize, len: usize) -> usize
Expand description

Calculate the length of a string.

use nc::c_str::strlen;
let buf = &[b'h', b'e', b'l', b'l', b'o', 0];
let l = strlen(buf.as_ptr() as usize, buf.len());
assert_eq!(l, 5);