- 下に日本語版があります
- Japanese follows English
- This repository contains my project for Rank 01 of the core curriculum at 42Tokyo.
- The project is done in November 2024.
- The specific project assignments are confidential, but students are permitted to publish their own code.
- Note to 42 students: This code may have been modified after its official evaluation. I cannot guarantee it will pass reviews.
- ft_printf is a project where students re-implement printf function as static library.
- ft_printf will be used in many subsequent projects from Rank 02 onwards.
- OS: Ubuntu 22.04 LTS (Jammy Jellyfish)
- Compiler:
cc(typically a symlink togcc) - Build Tool:
make
-
Clone the repository:
git clone [repository_url]
-
Navigate to the project directory:
cd [cloned_path] -
Compile the library:
make
This command creates the static library file,
libftprintf.a. -
Using the library: To link the
libftprintf.alibrary with your program (e.g.,main.c), use the following command:cc main.c -L. -lftprintf
-L.tells the compiler to search for libraries in the current directory.-lftprintftells the linker to link thelibftprintflibrary.
example of main function
// main.c #include "ft_printf.h" int main(void) { ft_printf("Hello, %s!\n", "world"); return 0; }
- このリポジトリは42Tokyo の基礎課程 (Rank 01) のプロジェクトです。
- このプロジェクトは2024.11に完了しています。
- 課題の詳細は公開が禁止されていますが、学生が自身で書いたコードを公開することは許可されています。
- 42の学生へ: このコードは評価時から変更されている可能性があります。そのため、このコードを参考にしたとき、レビューに合格することは保証しません。
- ft_printf は、C言語におけるprintfを再実装するプロジェクトです。
- このft_printfは、Rank02以降のプロジェクトでも使用します。
- OS: Ubuntu 22.04 LTS (Jammy Jellyfish)
- コンパイラ:
cc(実際にはgccへのシンボリックリンクであることが多い) - ビルドツール:
make
-
リポジトリをクローンする:
git clone [repository_url]
-
プロジェクトディレクトリに移動する:
cd [cloned_path] -
ライブラリをコンパイルする:
make
このコマンドで
libftprintf.aが生成されます
ちなみに、意味的にはlibft_printfではなくlib_ftprintfです -
ライブラリを使用する: 参考: 作成した
libftprintf.aを自作のプログラム(例:main.c)とリンクする方法cc main.c -L. -lftprintf
-L.は、現在のディレクトリでライブラリファイルを探す-lftprintfは、libftprintfライブラリをリンク
main関数の例
// main.c #include "ft_printf.h" int main(void) { ft_printf("Hello, %s!\n", "world"); return 0; }