Skip to content

rbakker96/libft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Libft

The aim of this project is to code a C library regrouping usual functions that can be used in all your other projects


Project summary

0th ring Codam project

This project intended to re-codes a set of the libc functions, as defined in their man. The functions will need to present the same prototype and behaviors as the originals. The functions’ names must be prefixed by “ft_”. For instance strlen becomes ft_strlen. As a bonus linked list functions are added to the library.


Technical considerations

The project needs to comply with the following rules/functionalities.

  • It is forbidden to use global variables.
  • If you need subfunctions to write a complex function, you should define these subfunctions as static to avoid publishing them with your library. It would be a good habit to do this in your future projects as well.
  • Submit all files in the root of your repository.
  • You must use the command ar to create your librairy, using the command libtool is forbidden.

Usage

Create a main to use the library functions, for example

// main.c

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

int	main(void)
{
	int length;

	length = ft_strlen("This is a test string");
	printf("Length = %d\n", length);

	return (0);
}

Run the following commands in the terminal

$ git clone https://github.com/rbakker96/libft.git libft
$ cd libft
$ make
$ gcc -Wall -Wextra -Werror main.c libft.a
$ ./a.out

Used resources

Most noteworthy resources used during this project

  • Man pages of re-coded functions

About

Libft project for Codam Coding College

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors