Skip to content

Nkosinathi-Bonga-James-Mncube/libft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libft

What is LIBFT?

wtc 42

  • Recreating 28 standard library functions in C language
  • Project done at WeThinkCode JHB campus (based on 42 france coding curriculum)


Table of contents

  1. Requirements of the project
  2. Installation
  3. How to use libft library

Language used

c_programming2

  • C

Requirements of the project:

  • Student are given the prototype for functions and must re-create behaviors as the originals
  • Heap allocated memory space must be properly freed when necessary (e.g use for Malloc)
  • A Makefile must be used to create a static library called libft.a
  • To use functions in library the header libft.h is used
  • To get a full project outline please refer to the pdf

Installation

makefile

  1. Create a new folder (e.g test_libft)
  2. git clone repo inside test_libft
  3. Enter /libft folder
  4. To compile Makefile type:
make re
  1. Go back to /test_libft

How to use libft library

output

  1. Inside /test_libft create a .c file (e.g.test.c)
  2. Open test.c and add library header#include 'libft/libft.h'
  3. Create a int main()
  4. Call a function from libft.h (e.g. ft_putstr("Hello World")) <- ft_putstr() is a LIBFT function to display a string to standard output
  5. To compile file type:
gcc test.c libft/libft.a
  1. To execute file type:
./a.out
  1. You should see
Hello World

displayed to standard output

Makefile commands

  • make re - recompile library when changes are made to functions
  • make clean - removes all function objects
  • make fclean - removes all function objects created with library object

Releases

No releases published

Packages

No packages published