-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetwidth.c
32 lines (29 loc) · 1.14 KB
/
getwidth.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* getwidth.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: abenheni <abenheni@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/04 13:29:57 by abenheni #+# #+# */
/* Updated: 2023/12/04 13:29:58 by abenheni ### ########.fr */
/* */
/* ************************************************************************** */
#include "render_map.h"
/*return the width of the longest line of the map*/
int getwidth(char **map)
{
size_t len;
int i;
i = 0;
len = ft_strlen(map[0]);
while (map[i])
{
if (ft_strlen(map[i]) > len)
{
len = ft_strlen(map[i]);
}
i++;
}
return (len);
}