> 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/c06.md).

# C06

C06 is an exciting module in the C Piscine curriculum that focuses on command-line argument handling and string manipulation in C. This module will enhance your understanding of how programs interact with the command line and improve your skills in working with arrays of strings.

### Key Learning Objectives

1. **Command-line Arguments**: You'll learn how to access and manipulate arguments passed to your program through the command line using `argc` and `argv`.
2. **String Manipulation**: The exercises will strengthen your ability to work with strings, particularly arrays of strings.
3. **Program Name Handling**: You'll understand how to access and use a program's own name in your code.
4. **Basic Sorting Algorithms**: The final exercise introduces you to implementing a simple sorting algorithm for strings.

### Exercise Breakdown

1. **ft\_print\_program\_name**: This exercise teaches you how to access and print your program's name, introducing you to `argv`.
2. **ft\_print\_params**: You'll learn to iterate through command-line arguments and print them, reinforcing your understanding of loops and `argv`.
3. **ft\_rev\_params**: This exercise challenges you to print arguments in reverse order, improving your array manipulation skills.
4. **ft\_sort\_params**: The most complex exercise, where you'll implement a sorting algorithm to arrange command-line arguments alphabetically. This combines string comparison, sorting logic, and argument handling.

By completing C06, you'll gain valuable experience in handling program inputs, which is crucial for creating interactive and flexible C programs. These skills form a foundation for more advanced topics in C programming and software development.


---

# 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/c06.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.
