tgrekov-fdf
HIVE fdf May 2024
Loading...
Searching...
No Matches
ft_memchr.c File Reference

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/24 17:31:16 by tgrekov #+# #+# */
/* Updated: 2023/11/04 22:46:42 by tgrekov ### ########.fr */
/* */
/* ************************************************************************** */

Definition in file ft_memchr.c.

#include "libft.h"
Include dependency graph for ft_memchr.c:

Go to the source code of this file.

Functions

void * ft_memchr (const void *s, int c, size_t n)
 Finds first occurence of c in byte string at s within n bytes.
 

Function Documentation

◆ ft_memchr()

void * ft_memchr ( const void *  s,
int  c,
size_t  n 
)

Finds first occurence of c in byte string at s within n bytes.

Check is done as unsigned char

Parameters
[in]sByte string haystack to search
[in]cint needle to find
[in]nNumber of bytes to check
Return values
void*Pointer to first occurence of needle c in haystack s.
NULL if none is found within n bytes.

Definition at line 33 of file ft_memchr.c.