Also contains main.c for additional testing. main.c should not be included in the final commit.
--- /dev/null
+// 28.06.2023 07:13
+
+void ft_swap(char **s1, char **s2)
+{
+ char *temp;
+
+ temp = *s1;
+ *s1 = *s2;
+ *s2 = temp;
+ return ;
+}
+
+int ft_strcmp(char *s1, char *s2)
+{
+ while (*s1 == *s2 && *s1 && *s2)
+ {
+ ++s1;
+ ++s2;
+ }
+ return (*s1 - *s2);
+}
+
+void ft_sort_string_tab(char **tab)
+{
+ int i;
+ int j;
+
+ if (!*tab)
+ return ;
+ i = 0;
+ while (tab[i + 1])
+ {
+ j = i + 1;
+ while (tab[j])
+ {
+ if (ft_strcmp(tab[i], tab[j]) > 0)
+ ft_swap(tab + i, tab + j);
+ ++j;
+ }
+ ++i;
+ }
+ return ;
+}
--- /dev/null
+//28.06.2023 07:29
+
+#include <unistd.h>
+
+void ft_sort_string_tab(char **tab);
+
+void print_str_arr(char **strs)
+{
+ while (*strs)
+ {
+ while (**strs)
+ write(1, (*strs)++, 1);
+ write(1, "\n", 1);
+ ++strs;
+ }
+ return ;
+}
+
+int main(int argc, char **argv)
+{
+ if (argc == 1)
+ return (0);
+ ft_sort_string_tab(argv + 1);
+ print_str_arr(argv + 1);
+ return (0);
+}