aboutsummaryrefslogtreecommitdiff
path: root/exam_final/rendu/ord_alphlong/main.c
blob: 5a46015b4e3ec60e397390fab1d6d83c983862ef (plain)
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
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   main.c                                             :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: exam <marvin@42.fr>                        +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2019/07/26 14:37:24 by exam              #+#    #+#             */
/*   Updated: 2019/07/26 16:33:22 by exam             ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#include <unistd.h>
#include <stdlib.h>
#include "include.h"

#include <stdio.h>
int	main(int argc, char **argv)
{
	char **strs;

	if (argc != 2)
	{
		write(1, "\n", 1);
		return (0);
	}
	strs = ft_split(argv[1]);
	sort_strs(strs, &strlen_cmp);
	sort_strs(strs, &str_lettercmp);
	print_strs(strs);
	return (0);
}