minishell
vect_at.c
Go to the documentation of this file.
1
/* ************************************************************************** */
2
/* */
3
/* ::: :::::::: */
4
/* vect_at.c :+: :+: :+: */
5
/* +:+ +:+ +:+ */
6
/* By: kfujita <kfujita@student.42tokyo.jp> +#+ +:+ +#+ */
7
/* +#+#+#+#+#+ +#+ */
8
/* Created: 2023/01/28 00:23:26 by kfujita #+# #+# */
9
/* Updated: 2023/01/28 01:23:28 by kfujita ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
13
#include "
ft_vect.h
"
14
15
void
*
vect_at
(
const
t_vect
*vect,
size_t
index)
16
{
17
unsigned
char
*p;
18
19
if
(vect->
len
<= index)
20
return
(NULL);
21
p = vect->
p
;
22
return
(p + (vect->
elemsize
* index));
23
}
ft_vect.h
t_vect
Definition:
ft_vect.h:24
t_vect::elemsize
size_t elemsize
Definition:
ft_vect.h:27
t_vect::p
void * p
Definition:
ft_vect.h:28
t_vect::len
size_t len
Definition:
ft_vect.h:26
vect_at
void * vect_at(const t_vect *vect, size_t index)
Definition:
vect_at.c:15
libft
ft_vect
vect_at.c
Generated by
1.9.1