Your very first own library
This project is about coding a C library. It will contain a lot of general purpose functions your programs will rely upon.
C Programming can be very tedious when one doesn't have access to the highly useful standard functions.
This project is about understanding the way these functions work, implementing and learning to use them.
You will create your own library. It will be helpful since you will use it in your next C school assignments.
Take the time to expand your libft throughout the year. However, when working on a new project, don't forget to
ensure the functions used in your library are allowed in the project guidelines.
For more detailed information, look at the subject of this project.
ft_isupper
- Checks for an uppercase character.ft_islower
- Checks for a lowercase character.ft_isalpha
- Checks for an alphabetic character. It is equivalent to (isupper(c) || islower(c)).ft_isdigit
- Checks for a digit (0 through 9).ft_isxdigit
- Checks for hexadecimal digits. That is, one of 0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F.ft_isspace
- Checks for white-space characters.ft_isprint
- Checks for any printable character including space.ft_isgraph
- Checks for any printable character except space.ft_isblank
- Checks for a blank character. That is, a space or a tab.ft_iscntrl
- Checks for a control character.ft_ispunct
- Checks for a character is a punctuation. All punctuations in c: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~.ft_isalnum
- Checks for an alphanumeric character. It is equivalent to (isalpha(c) || isdigit(c)).ft_isascii
- Checks whether c is a 7-bit unsigned char value that fits into the ASCII character set.ft_toupper
- Lower case to upper case character conversion.ft_tolower
- Upper case to lower case character conversion.
ft_min
- Returns the smaller.ft_max
- Returns the larger.ft_median
- Return the middle of the three.ft_swap
- Swap values of a and b.
ft_printf
- Write formatted output to stdout.ft_dprintf
- Write formatted output to file.ft_sprintf
- Write formatted output to string.ft_get_next_line
- Read a next line from a file.
ft_abs
- Returns the absolute value.ft_atoi
- Converts the initial portion of the string to int.ft_itoa
- Converts an integer to ASCII string.ft_calloc
- Allocates memory set to zero.
ft_memcmp
- Compares the first n bytes (each interpreted as unsigned char) of the memory areas.ft_memcpy
- Copies n bytes from memory area src to memory area dest. The memory areas must not overlap.ft_memset
- Fills the first n bytes of the memory area with the constant byte c.ft_strlen
- Calculates the length of the string.ft_strcat
- Appends the src string to the dest string.ft_strncat
- Appends the src string to the dest string at most n bytes.ft_strchr
- Find the first occurrence of the character c in the string.ft_strrchr
- Find the last occurrence of the character c in the string.ft_strcmp
- Compares the two strings.ft_strncmp
- Compares the two strings at most n bytes.ft_strcpy
- Copies the string pointed to by src, including the terminating null byte ('\0'), to the buffer pointed to by dest.ft_strncpy
- Copies the string pointed to by src at most n bytes, including the terminating null byte ('\0'), to the buffer pointed to by dest.ft_strdup
- Copy the string.ft_strndup
- Copy the string at most n bytes.ft_strstr
- Finds the first occurrence of the substring needle in the string haystack.
ft_bzero
- Write zeroes to a byte string.ft_split
- Split string with delimiter into an array of strings.ft_strrev
- Reverse the string s.ft_strtok
- Breaks a string into a sequence of zero or more nonempty tokens.ft_strtrim
- Removes the space before and after of the string.ft_strjoin
- Concatenate two strings into a new string.ft_strcjoin
- Concatenate two strings with c between them.
The library is written in C language and thus needs the C compiler and some standard C libraries to run.
- Pull files
↙️
$ git clone https://github.com/juwkim/libft
- To build libft
↙️
$ make
- To clean all object files (.o) and library file (.a)
↙️
$ make fclean
- To check this repository complies with norminette
↙️
$ make norm
- To use libft in your code
↙️
#include "libft.h"