diff options
Diffstat (limited to 'rushs/tinyprintf/my_strlowcase')
| -rw-r--r-- | rushs/tinyprintf/my_strlowcase/my_strlowcase.c | 13 | ||||
| -rw-r--r-- | rushs/tinyprintf/my_strlowcase/my_strlowcase.h | 8 |
2 files changed, 21 insertions, 0 deletions
diff --git a/rushs/tinyprintf/my_strlowcase/my_strlowcase.c b/rushs/tinyprintf/my_strlowcase/my_strlowcase.c new file mode 100644 index 0000000..e52ea32 --- /dev/null +++ b/rushs/tinyprintf/my_strlowcase/my_strlowcase.c @@ -0,0 +1,13 @@ +#include "my_strlowcase.h" + +void my_strlowcase(char *s) +{ + size_t i; + for (i = 0; s[i]; i++) + { + if (s[i] >= 'A' && s[i] <= 'Z') + { + s[i] += ('a' - 'A'); + } + } +} diff --git a/rushs/tinyprintf/my_strlowcase/my_strlowcase.h b/rushs/tinyprintf/my_strlowcase/my_strlowcase.h new file mode 100644 index 0000000..d4996b8 --- /dev/null +++ b/rushs/tinyprintf/my_strlowcase/my_strlowcase.h @@ -0,0 +1,8 @@ +#ifndef MY_STRLOWCASE_H +#define MY_STRLOWCASE_H + +#include <stddef.h> + +void my_strlowcase(char *str); + +#endif /* ! MY_STRLOWCASE_H */ |
