Giter VIP home page Giter VIP logo

42_c_library_libft's Introduction

Recreating C Library - string.h and ctype.h

This is the first project in the curriculum provided by software engineering school - 42.

This project recreates functions from string.h and ctype.h libraries. Apart from creating functions from these libraries, the project also creates some new functions.

Except for linked list functions, test cases are provided at the bottom for all the remaining functions which are commented.

Compiling a program.

Compiling can be tricky.gcc, clang or cc can be used to compile. But the Makefile created for this program uses gcc and instuction in this README will also use gcc.

There are severeal methods to compile. For instance, in order to compile ft_strsplit.c program, following command can be ran:

gcc ft_strsplit.c ft_endtrim.c ft_strsub.c ft_wordcount.c ft_strlen.c

This gives an a.out file, which can be executed by simply typing ./a.out.

But the trouble to compile a program by this method is that all of the the functions that are used in a program will be included and each function that calls on to additional functions would also have to be included. This would get challenging when a big program is compiled.

Installation

In order to make compiling easy, Makefile is created. Typing and entering make will create .o file for each file and it will also create libft.a which is a static library. Now including this static library with a program will compile the program without having to include any additional programs or files. Below are the commands.

make
gcc ft_strsplit.c libft.a
./a.out

There are also additionals components in Makefile

  • make clean will remove all the .o files.
  • make fclean will remove all the .o files and libft.a, which is the static library.
  • make re will remove all the .o files and libft.a. And then it will remake the .o files and libft.a.

Below are the snapshots of these functions.

To assess how the functions performed, these functions were tested using the libft-unit-test, created by a 42 student.

The project also passed the Moulibft tests, also created by a 42 Student.

42_c_library_libft's People

Contributors

mohammadbutt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.