C Piscine: Summary: This Document Is The Subject For The Module C 10 of The C Piscine at 42
C Piscine: Summary: This Document Is The Subject For The Module C 10 of The C Piscine at 42
C Piscine: Summary: This Document Is The Subject For The Module C 10 of The C Piscine at 42
C 10
Summary: This document is the subject for the module C 10 of the C Piscine @ 42.
Version: 5.2
Contents
I Instructions 2
II Foreword 4
IV Exercise 01 : cat 6
V Exercise 02 : tail 7
VI Exercise 03 : hexdump 8
1
Chapter I
Instructions
• Make sure you have the appropriate permissions on your files and directories.
• You have to follow the submission procedures for all your exercises.
• On top of that, your exercises will be checked and graded by a program called
Moulinette.
• Moulinette is very meticulous and strict in its evaluation of your work. It is entirely
automated and there is no way to negotiate with it. So if you want to avoid bad
surprises, be as thorough as possible.
• Moulinette is not very open-minded. It won’t try and understand your code if it
doesn’t respect the Norm. Moulinette relies on a program called norminette to
check if your files respect the norm. TL;DR: it would be idiotic to submit a piece
of work that doesn’t pass norminette’s check.
• These exercises are carefully laid out by order of difficulty - from easiest to hardest.
We will not take into account a successfully completed harder exercise if an easier
one is not perfectly functional.
• Using a forbidden function is considered cheating. Cheaters get -42, and this grade
is non-negotiable.
• Moulinette compiles with these flags: -Wall -Wextra -Werror, and uses cc.
• You cannot leave any additional file in your directory than those specified in the
subject.
• Got a question? Ask your peer on the right. Otherwise, try your peer on the left.
2
C Piscine C 10
• Check out the "C Piscine" part of the forum on the intranet, or the slack Piscine.
• Examine the examples thoroughly. They could very well call for details that are
not explicitly mentioned in the subject...
3
Chapter II
Foreword
The song "Cop Killer" was the subject of much controversy. Although Sire
Records’ parent company, Warner Bros. Records, defended the single,
Ice-T chose to remove the track from the album because he felt
that the controversy had eclipsed the music itself. The group left
Sire the following year. Since then, they have released three further
albums on different labels, none of which have been received as commercially
or critically well as their debut album.
4
Chapter III
Exercise 00 : display_file
Exercise 00
display_file
Turn-in directory : ex00/
Files to turn in : Makefile, and files needed for your program
Allowed functions : close, open, read, write
• The submission directory should have a Makefile with the following rules : all,
clean, fclean. The binary will be called ft_display_file.
• The malloc function is forbidden. You can only do this exercise by declaring a
fixed-sized array.
5
Chapter IV
Exercise 01 : cat
Exercise 01
cat
Turn-in directory : ex01/
Files to turn in : Makefile, and files needed for your program
Allowed functions : close, open, read, write, strerror, basename
• Create a program called ft_cat which does the same thing as the system’s cat
command-line.
• The submission directory should have a Makefile with the following rules : all,
clean, fclean.
• You may use the variable errno (check the man for Errno).
• You can only do this exercise by declaring a fixed-sized array. This array will have
a size limited to a little less than 30 ko. In order to test that size-limit, use the
ulimit command-line in your Shell.
6
Chapter V
Exercise 02 : tail
Exercise 02
tail
Turn-in directory : ex02/
Files to turn in : Makefile, and files needed for your program
Allowed functions : close, open, read, write, malloc, free, strerror,
basename
• Create a program called ft_tail which does the same thing as the system command
tail.
• The only option you have to handle is -c, but you don’t need to handle ’+’ or ’-’
signs.
• The submission directory should have a Makefile with the following rules : all,
clean, fclean.
7
Chapter VI
Exercise 03 : hexdump
Exercise 03
hexdump
Turn-in directory : ex03/
Files to turn in : Makefile, and files needed for your program
Allowed functions : close, open, read, write, malloc, free, strerror,
basename
• Create a program called ft_hexdump which does the same thing as the system’s
hexdump command-line without redirection.
• The submission directory should have a Makefile with the following rules : all,
clean, fclean.
8
Chapter VII
Turn in your assignment in your Git repository as usual. Only the work inside your repos-
itory will be evaluated during the defense. Don’t hesitate to double check the names of
your files to ensure they are correct.
You need to return only the files requested by the subject of this
project.