Beispiel #1
0
int			ft_printf(const char *format, ...)
{
    va_list			args;
    char			*p;
    size_t			size;

    va_start(args, format);
    p = NULL;
    size = 0;
    while (*format)
        ft_switch((char **)&format, args, &size, &p);
    ft_putstr(p);
    ft_memdel((void **)&p);
    va_end(args);
    return (size + g_null);
}
Beispiel #2
0
void	ft_list_reverse_fun(t_list *begin_list)
{
	t_list	*begin;
	t_list	*middle;
	t_list	*head;
	t_list	*node_two;

	if (begin_list == NULL || begin_list->next == NULL)
		return ;
	if (begin_list->next->next == NULL)
	{
		ft_two_nodes(&begin_list);
		return ;
	}
	begin = begin_list;
	middle = begin_list->next;
	head = begin_list->next->next;
	node_two = begin_list->next;
	ft_switch(&begin, &middle, &head);
	ft_data_switch(&begin_list, &head);
	begin_list->next = middle;
	node_two->next = head;
	head->next = NULL;
}