libft
Loading...
Searching...
No Matches
vec_new.c File Reference
#include "vec.h"

Go to the source code of this file.

Functions

int vec_new (t_vec *dst, size_t init_len, size_t elem_size)
 Creates a new vector.
 

Function Documentation

◆ vec_new()

int vec_new ( t_vec dst,
size_t  init_len,
size_t  elem_size 
)

Creates a new vector.

Allocates init_len * elem_size bytes of memory.

Parameters
dstt_vec*
init_lensize_t
elem_sizesize_t
Returns
int -1 if malloc fails otherwise 1
Attention
Allocates memory

Definition at line 16 of file vec_new.c.