Skip to content

liruly/42_ft_printf.pub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

  • 下に日本語版があります
  • Japanese follows English

English Part (英語版)

Overview

  • 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.

Environment

  • OS: Ubuntu 22.04 LTS (Jammy Jellyfish)
  • Compiler: cc (typically a symlink to gcc)
  • Build Tool: make

Usage

  1. Clone the repository:

    git clone [repository_url]
  2. Navigate to the project directory:

    cd [cloned_path]
  3. Compile the library:

    make

    This command creates the static library file, libftprintf.a.

  4. Using the library: To link the libftprintf.a library 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.
    • -lftprintf tells the linker to link the libftprintf library.
      example of main function
    // main.c
    #include "ft_printf.h"
    
    int main(void)
    {
        ft_printf("Hello, %s!\n", "world");
        return 0;
    }

日本語版 (Japanese Part)

概要

  • このリポジトリは42Tokyo の基礎課程 (Rank 01) のプロジェクトです。
  • このプロジェクトは2024.11に完了しています。
  • 課題の詳細は公開が禁止されていますが、学生が自身で書いたコードを公開することは許可されています。
    • 42の学生へ: このコードは評価時から変更されている可能性があります。そのため、このコードを参考にしたとき、レビューに合格することは保証しません。
  • ft_printf は、C言語におけるprintfを再実装するプロジェクトです。
  • このft_printfは、Rank02以降のプロジェクトでも使用します。

環境

  • OS: Ubuntu 22.04 LTS (Jammy Jellyfish)
  • コンパイラ: cc (実際にはgccへのシンボリックリンクであることが多い)
  • ビルドツール: make

使い方

  1. リポジトリをクローンする:

    git clone [repository_url]
  2. プロジェクトディレクトリに移動する:

    cd [cloned_path]
  3. ライブラリをコンパイルする:

    make

    このコマンドで libftprintf.a が生成されます
    ちなみに、意味的にはlibft_printfではなくlib_ftprintfです

  4. ライブラリを使用する: 参考: 作成した 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;
    }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors