/Libc-Utils-Plus

Extended Implemented C Library with Printf, Getline and 50+ Utility Functions.

Primary LanguageC

Libft - Printf, Getline and 50+ Utility Functions

mybadge

Extended Implemented C Library with Printf, Getline and 50+ Utility Functions.

🔧 System Requirements:

  • Operating System: Unix-based OS
  • Software: make, gcc

Usage

To run the command, open your terminal and follow these steps:

  • To create libft.a:

    (cd /path/to/project/directory && make)
  • To compile with libft.a:

    (cd /path/to/project/directory && make)
    gcc -o a.out *.o -I </path/to/project/directory>/libft/includes -L /path/to/project/directory -lft

Functions


Ft_printf :

# include "ft_printf.h"
  • ft_printf - int ft_printf(const char *format, ...);

  • ft_dprintf - int ft_dprintf(int fd, const char *format, ...);

    Types conversions :

    • %c print a single character.
    • %s print a string of characters.
    • %p The void * pointer argument is printed in hexadecimal
    • %d print a decimal (base 10) number.
    • %i print an integer in base 10.
    • %u print an unsigned decimal (base 10) number.
    • %x print a number in lowercase hexadecimal (base 16).
    • %X print a number in uppercase hexadecimal (base 16).
    • %% print a percent sign.

    Flag directives (use them between '%' character and the type conversion):

    • - left align the result within the given field width.
    • + use a sign (+ or -) to prefix the output value if it's of a signed type.
    • # When it's used with the o, x, or X format, the # flag uses 0, 0x, or 0X, respectively.
    • 0 If width is prefixed by 0, leading zeros are added until the minimum width is reached.
    • blank (' ') use a blank to prefix the output value if it's signed and positive.
    • . the precision specification
    • \<number\> the width specification field.

Ft_getline :

# include "ft_getline.h"

Others Functions :

# include "ft_libft.h"

Functions from <ctype.h> library

Functions from <stdlib.h> library

Functions from <string.h> library

Non-standard functions

  • ft_putchar_fd - output a character to given file.
  • ft_putstr_fd - output string to given file.
  • ft_putendl_fd - output string to given file with newline.
  • ft_putnbr_fd - output integer to given file.
  • ft_itoa - convert integer to ASCII string.
  • ft_substr - extract substring from string.
  • ft_strtrim - trim beginning and end of string with the specified characters.
  • ft_strjoin - concatenate two strings into a new string (with malloc).
  • ft_split - split string, with specified character as delimiter, into an array of strings.
  • ft_strmapi - create new string from modifying string with specified function.

Linked list functions