Exam 01 Piscine 42 «4K»

char *ptr = dest; while ((*ptr++ = *src++)) ; return (dest);

In the context of the 42 School selection process, "Exam 01" typically takes place at the end of the second week of the Piscine

#include <unistd.h>

When you see a red Failure mark on an exercise you were certain was correct, your adrenaline will spike. Take your hands off the keyboard. Breathe for 60 seconds. Moulinette does not give partial credit; a single wrong space means zero points. Search for edge cases (e.g., What if the input string is empty? What if the pointer is NULL?). Exam 01 Piscine 42

It typically comes you’ve done basic shell, C syntax, and simple algorithmic exercises during the first ~10 days of Piscine.

Review specific (pointers, structs, etc.).

Do not let the exam shell be a surprise. Practice using the local simulator tools or review how the grademe protocol works. Know how to fetch your assignment, where to create your directory, and how to push your code for grading. 2. Read the Assignment Checklist Twice char *ptr = dest; while ((*ptr++ = *src++))

Write a function ft_strcpy that copies the string src to dest (including the terminating \0 ). It returns dest .

int ft_strlen(char *str); Goal: Return the number of characters in a string (excluding the null terminator \0 ). Common pitfall: Infinite loops due to forgetting the \0 check.

: Implementing basic loops ( while ) and conditional statements ( if / else ) to solve simple logic problems like FizzBuzz . Moulinette does not give partial credit; a single

: A common piece of advice is to prioritize validating the C06 project before C05. This is because Exam 01 heavily tests your understanding of argc and argv .

char *ft_strcpy(char *dest, char *src); Goal: Copy the string src (including the terminating \0 ) into dest . Return dest . This is the "Gatekeeper" of Exam 01. If you cannot write ft_strcpy from memory in under 10 minutes, you are not ready. Memorize the loop: while (*src) *dest++ = *src++; *dest = '\0';

The difficulty of the exam is cumulative. To succeed in Exam 01, you should be comfortable with: