Skip to content

RanniSch/Libft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Libft

This project is about coding a C library. It contains a lot of general purpose functions that the following programs rely on.

Every .c file compiles with the flags -Wall -Wextra -Werror.

How to run the code

Enter the repository with cd and add a "main.c" with touch main.c.
For example copy paste the following code into main to test the ft_atoi function:

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

int main()
{
    int convert;
    char string[5] = "-+48";
    char    *str;

    str = &string[0];
    convert = ft_atoi(str);
    printf ("%d\n", convert);
    return 0;
}

Run make (to run the Makefile that will compile the source code and create the library).
You should now see a libft.a file and some object files (.o).
To clean up (removing the .o files), call make clean.

Compile your .c files with gcc using gcc main.c libft.a. You need to include the libft.a to tell the file which library it is using.

Now you can run the code using ./a.out.

libft-01

About

may2022

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors