libft / ft_lstiter.c 109 commits
14-04-2026
22 lines 1.0 kB
 1/* ************************************************************************** */
 2/*                                                                            */
 3/*                                                        :::      ::::::::   */
 4/*   ft_lstiter.c                                       :+:      :+:    :+:   */
 5/*                                                    +:+ +:+         +:+     */
 6/*   By: mleitao <mleitao@student.42.fr>            +#+  +:+       +#+        */
 7/*                                                +#+#+#+#+#+   +#+           */
 8/*   Created: 2026/03/16 19:10:56 by mleitao           #+#    #+#             */
 9/*   Updated: 2026/04/14 19:18:55 by mleitao          ###   ########.fr       */
10/*                                                                            */
11/* ************************************************************************** */
12
13#include "libft.h"
14
15void	ft_lstiter(t_list *lst, void (*f)(void *))
16{
17	while (lst)
18	{
19		f(lst->content);
20		lst = lst->next;
21	}
22}