ft_tabnew.c 1.1 KB

1234567891011121314151617181920212223242526
  1. /* ************************************************************************** */
  2. /* */
  3. /* ::: :::::::: */
  4. /* ft_tabnew.c :+: :+: :+: */
  5. /* +:+ +:+ +:+ */
  6. /* By: bchanot <bchanot@students.42.fr> +#+ +:+ +#+ */
  7. /* +#+#+#+#+#+ +#+ */
  8. /* Created: 2016/12/04 02:51:17 by bchanot #+# #+# */
  9. /* Updated: 2018/10/14 03:21:17 by bchanot ### ########.fr */
  10. /* */
  11. /* ************************************************************************** */
  12. #include "libft.h"
  13. char **ft_tabnew(size_t len)
  14. {
  15. char **tab;
  16. size_t i;
  17. i = -1;
  18. if (!(tab = (char **)ft_memalloc(sizeof(char *) * (len + 1))))
  19. return (NULL);
  20. while (++i <= len)
  21. tab[i] = 0;
  22. return (tab);
  23. }