libft
Functions
ft_strnew.c File Reference
#include "libft.h"
+ Include dependency graph for ft_strnew.c:

Go to the source code of this file.

Functions

char * ft_strnew (size_t size)
 Allocates a fresh string. More...
 

Function Documentation

◆ ft_strnew()

char* ft_strnew ( size_t  size)

Allocates a fresh string.

Allocates (with malloc) and returns a “fresh” string ending with '\0'. Each character of the string is initialized at '\0'.

Parameters
sizeThe size of the string to be allocated.
Returns
The string allocated and initialized to 0 or NULL if allocation failed.

Definition at line 25 of file ft_strnew.c.