Skip to content

Codam libft project - recreate C Library functions

Notifications You must be signed in to change notification settings

DelicaTessa/42-libft

Repository files navigation

libft

This project creates a library with standard libc functions and several other generic functions, which will be used for other 42 projects.

The purpose is to help us develop a deep understanding of the standard libc functions and how to use them.

Technical considerations

  • Allowed functions: malloc, free, write
  • All heap allocated memory space must be properly freed when necessary

Included functions

libc functionss

string manipulation

linked list manipulation

How to test

To test the library, create a test.c file to compile with the libft.a library

# include "libft.h"
# include <stdio.h>

int	main(void)
{
	char	*str;
	int	ret;

	str = "123456789";
	ret = ft_atoi(str);
	printf("ret is %d\n", ret);
	return (0);
}

Run the commands below. You can replace the test.c with your own test file

$ git clone https://github.com/DelicaTessa/42-libft.git
$ cd 42-libft
$ make
$ make bonus
$ gcc test.c libft.a
$ ./a.out