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

Go to the source code of this file.

Functions

char * ft_strmapi (char const *s, char(*f)(unsigned int, char))
 Create a copy of a string passing each char through a function.
 

Function Documentation

◆ ft_strmapi()

char * ft_strmapi ( char const *  s,
char(*)(unsigned int, char)  f 
)

Create a copy of a string passing each char through a function.

Creates a new string and assigns the values to that string by taking a character from the string s and passing it trough the function f. Function f takes a character and index of that character as parameters.

Parameters
sString
fFunction
Returns
char* New string
Attention
Allocates memory

Definition at line 15 of file ft_strmapi.c.