/42_Exams-C-beginner

Solutions of the C beginner exam at 42 Silicon Valley

Primary LanguageC

42_Exams-C

Solutions of the C beginner exam at 42 Silicon Valley. More solutions to come

Beginner

Show Level 0 Questions
Problems/Subjects Code
aff_a 📖
aff_first_param 📖
aff_last_param 📖
aff_z 📖
ft_countdown 📖
ft_print_numbers 📖
hello 📖
maff_alpha 📖
maff_revalpha 📖
only_a 📖
only_z 📖

Show Level 1 Questions
Problems/Subjects Code
first_word 📖
fizz_buzz 📖
ft_putstr 📖
ft_strcpy 📖
ft_strlen 📖
ft_swap 📖
repeat_alpha 📖
rev_print 📖
rot_13 📖
rotone 📖
search_and_replace 📖
ulstr 📖

Show Level 2 Questions
Problems/Subjects Code
alpha_mirror 📖
do_op 📖
ft_atoi 📖
ft_strcmp 📖
ft_strcspn 📖
ft_strdup 📖
ft_strpbrk 📖
ft_strrev 📖
ft_strspn 📖
inter 📖
is_power_of_2 📖
last_word 📖
max 📖
print_bits 📖
reverse_bits 📖
snake_to_camel 📖
swap_bits 📖
union 📖
wdmatch 📖

Show Level 3 Questions
Problems/Subjects Code
add_prime_sum 📖
epur_str 📖
expand_str 📖
ft_atoi_base
ft_list_size 📖 📜
ft_range 📖
ft_rrange 📖
hidenp 📖
lcm 📖
paramsum 📖
pgcd 📖
print_hex 📖
rstr_capitalizer 📖
str_capitalizer 📖
tab_mult 📖

Show Level 4 Questions
Problems/Subjects Code
fprime 📖
ft_itoa 📖
ft_list_foreach 📖 📜
ft_list_remove_if
ft_split 📖 📚
rev_wstr 📖
rostring 📖
sort_int_tab 📖
sort_list 📜

Show Level 5 Questions
Problems/Subjects Code
brackets 📖
brainfuck
check_mate
ft_itoa_base 📖
options
print_memory
rpn_calc 📖

Debug using LLDB

gcc filename.c -g
lldb a.out
b main
run
gui

pressing s each time will progress the program 1 step forward.

Find Segmentation fault using LLDB

gcc filename.c
lldb ./a.out
run

This will likely show assembly code, but it will show the name of the function which is causing segmentation fault. Files can be compiled mannually to see the source code in C that is causing segmentation fault. When I figure that out I will post it.