method T.offset
Pointer n elements further (negative n goes back). No bounds check.
Example:
fn main() io {
let s = "abc".toCString()
let second = unsafe { s.asPtr().offset(1).read() }
print("{second}")
}Output
98
pub(api) move unsafe fn offset(n: isize) -> *TSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
n | isize |
Returns
*T
Effects
none declared (pure unless the body says otherwise)
Defined in: std/ffi/ffi.oxl:278