diff options
| author | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:08:27 +0200 |
|---|---|---|
| committer | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:08:27 +0200 |
| commit | c9b6b9a5ca082fe7c1b6f58d7713f785a9eb6a5c (patch) | |
| tree | 3e4f42f93c7ae89a364e4d51fff6e5cec4e55fa9 /rushs/tinyprintf/check_alphabet/check_alphabet.c | |
add: graphs et rushs
Diffstat (limited to 'rushs/tinyprintf/check_alphabet/check_alphabet.c')
| -rw-r--r-- | rushs/tinyprintf/check_alphabet/check_alphabet.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/rushs/tinyprintf/check_alphabet/check_alphabet.c b/rushs/tinyprintf/check_alphabet/check_alphabet.c new file mode 100644 index 0000000..fc540b4 --- /dev/null +++ b/rushs/tinyprintf/check_alphabet/check_alphabet.c @@ -0,0 +1,25 @@ +#include "check_alphabet.h" + +#include <stddef.h> + +int check_alphabet(const char *str, const char *alphabet) +{ + if (alphabet == NULL || *alphabet == '\0') + { + return 1; + } + + for (int i = 0; alphabet[i]; i++) + { + int j; + for (j = 0; str[j] && str[j] != alphabet[i]; j++) + { + continue; + } + if (str[j] == '\0') + { + return 0; + } + } + return 1; +} |
