- What are pointers to pointers and how to use them
- What are multidimensional arrays and how to use them
- What are the most common C standard library functions to manipulate strings
- _putchar.c: Provided by Holberton School
- main.h: Contains prototypes for all functions used in this project.
File | Prototype |
---|---|
0-memset.c |
char *_memset(char *s, char b, unsigned int n); |
1-memcpy.c |
char *_memcpy(char *dest, char *src, unsigned int n); |
2-strchr.c |
char *_strchr(char *s, char c); |
3-strspn.c |
unsigned int _strspn(char *s, char *accept); |
4-strpbrk.c |
char *_strpbrk(char *s, char *accept); |
5-strstr.c |
char *_strstr(char *haystack, char *needle); |
7-print_chessboard.c |
void print_chessboard(char (*a)[8]); |
8-print_diagsums.c |
void print_diagsums(int *a, int size); |
9-set_string.c |
void set_string(char **s, char *to); |
-
0. memset
- 0-memset.c: C function that fills the first
n
bytes of memory area pointed to bys
with the constant byteb
.- Returns a pointer to the filled memory area
s
.
- Returns a pointer to the filled memory area
- 0-memset.c: C function that fills the first
-
1. memcpy
- 1-memcpy.c: C function that copies
n
bytes from memory areasrc
to memory areadest
.- Returns a pointer to the memory area
dest
.
- Returns a pointer to the memory area
- 1-memcpy.c: C function that copies
-
2. strchr
- 2-strchr.c: C function that returns a pointer to the first occurence of
the character
c
in the strings
.- If the character is not found, the function returns
NULL
.
- If the character is not found, the function returns
- 2-strchr.c: C function that returns a pointer to the first occurence of
the character
-
3. strspn
- 3-strspn.c: C function that returns the number of bytes in the intitial
segment of memory area
s
which consist only of bytes from a substringaccept
.
- 3-strspn.c: C function that returns the number of bytes in the intitial
segment of memory area
-
4. strpbrk
- 4-strpbrk.c: C function that locates the first occurence in a
string
s
of any of the bytes in a stringaccept
.- Returns a pointer to the byte in
s
that matches one of the bytes inaccept
. - If no matching byte is found, the function returns
NULL
.
- Returns a pointer to the byte in
- 4-strpbrk.c: C function that locates the first occurence in a
string
-
5. strstr
- 5-strstr.c: C function that finds the first occurence of a
substring
needle
in a stringhaystack
.- The terminating null bytes (
\0
) are not compared. - Returns a pointer to the beginning of the located substring.
- If the substring is not found, the function returns
NULL
.
- The terminating null bytes (
- 5-strstr.c: C function that finds the first occurence of a
substring
-
6. Chess is mental torture
- 7-print_chessboard.c: C function that prints the chessboard.
-
7. The line of life is a ragged diagonal between duty and desire
- 8-print_diagsums.c: C function that prints the sum of the two diagonals of a square matrix of integers.
-
8. Double pointer, double fun
- 9-set_string.c: C function that sets the value of a pointer to a char.
-
9. My primary goal of hacking was the intellectual curiosity, the seduction of adventure
- 101-crackme_password: File containing the password for the crackme2 executable.