#[no_mangle]
pub extern "C" fn nstd_cstring_new_with_cap(
    cap: NSTDUInt
) -> NSTDCString
Available on crate feature nstd_cstring only.
Expand description

Creates a new NSTDCString initialized with the given capacity.

Parameters:

  • NSTDUInt cap - The number of bytes to allocate ahead of time.

Returns

NSTDCString cstring - The new C string.

Panics

This function will panic if either cap is zero or allocating fails.

Example

use nstd_sys::cstring::nstd_cstring_new_with_cap;

let cstring = nstd_cstring_new_with_cap(10);