-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_vargscount.c
29 lines (26 loc) · 1.04 KB
/
ft_vargscount.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_vargscount.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rahidalg <rahidalg@student.42madrid.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/07 13:08:04 by rahidalg #+# #+# */
/* Updated: 2024/05/07 13:08:10 by rahidalg ### ########.fr */
/* */
/* ************************************************************************** */
#include "libftprintf.h"
int ft_vargscount(char const *s)
{
size_t i;
size_t n;
i = 0;
n = 0;
while (s[i])
{
if (s[i] == '%')
n++;
i++;
}
return (n);
}