-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_strlen.c
More file actions
34 lines (31 loc) · 1.22 KB
/
Copy pathft_strlen.c
File metadata and controls
34 lines (31 loc) · 1.22 KB
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
33
34
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlen.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kjurkows <kjurkows@student.42warsaw.pl> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/06/15 20:39:46 by kjurkows #+# #+# */
/* Updated: 2026/06/25 17:41:13 by kjurkows ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
//# Part 1
//## string manipulation
/** @brief calculate string length
*
* count characters up to first `NUL`-terminator (`'\0'`)
*
* @param s string being array of `char`
* @return length of a string
*/
size_t ft_strlen(const char *s)
{
size_t len;
if (!s)
return (0);
len = 0;
while (s[len])
len++;
return (len);
}