> For the complete documentation index, see [llms.txt](https://42-guide.gitbook.io/42-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://42-guide.gitbook.io/42-guide/piscine-life/c03.md).

# C03

In this module, you’ll deepen your understanding of string manipulation by working with comparison, concatenation, and search functions in C. This section focuses on reproducing fundamental string-processing functions, helping you better understand how they work at a lower level.

***

#### **What You'll Learn:**

**String Comparison:**

* Implement functions that compare strings character by character to determine their lexicographical order.

**String Concatenation:**

* Join strings together while handling buffer limitations safely.

**String Search:**

* Locate substrings within larger strings using efficient methods.

**Reproducing Standard Library Functions:**

* Implement versions of standard C functions like `strcmp`, `strncpy`, `strcat`, `strstr`, and `strlcat`.

***

#### **Projects in This Section:**

1. **ft\_strcmp**
   * Reproduce `strcmp` to compare two strings and return their difference.
   * Prototype: `int ft_strcmp(char *s1, char *s2);`
2. **ft\_strncmp**
   * Reproduce `strncmp` to compare up to `n` characters of two strings.
   * Prototype: `int ft_strncmp(char *s1, char *s2, unsigned int n);`
3. **ft\_strcat**
   * Reproduce `strcat` to concatenate two strings.
   * Prototype: `char *ft_strcat(char *dest, char *src);`
4. **ft\_strncat**
   * Reproduce `strncat` to concatenate up to `n` characters from `src` to `dest`.
   * Prototype: `char *ft_strncat(char *dest, char *src, unsigned int nb);`
5. **ft\_strstr**
   * Reproduce `strstr` to find the first occurrence of a substring within a string.
   * Prototype: `char *ft_strstr(char *str, char *to_find);`
6. **ft\_strlcat**
   * Reproduce `strlcat` to concatenate strings while ensuring a buffer size limit.
   * Prototype: `unsigned int ft_strlcat(char *dest, char *src, unsigned int size);`

***

These exercises will strengthen your ability to work with strings and pointers in C. You'll gain a deeper understanding of how standard string functions operate internally, preparing you for more advanced C programming concepts.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://42-guide.gitbook.io/42-guide/piscine-life/c03.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
