本文へスキップ
製品デスクトップツールTASTECAD図面の確認TASTEFILESファイル管理TASTEFTPファイル転送TASTESSHリモートワークスペースTASTEZIP圧縮と展開TASTEWINMファイル管理開発ツールTASTECODERust 統合開発環境TASTESTUDIO統合開発・テスト環境TASTEETLデータ統合(ETL)サーバーTASTEREMOTEリモートデスクトップサーバーTASTEGEO空間情報サーバーTASTEMAILメールワークスペース投資TASTESTOCK株式自動売買デスクトップアプリはじめるダウンロードドキュメント購入すべての製品
マーケットプレイス
ニュース
技術ニュース今日の開発ニュース開発ドキュメントプログラミング言語RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartWebフロントエンド フレームワークNext.jsReactVue.js · NuxtSvelteKitAngularサーバー フレームワークSpring BootDjangoFastAPIASP.NET CoreNestJS · Expressアプリ・デスクトップ フレームワークTauriFlutterReact NativeElectronアルゴリズムアルゴリズムの基礎主要アルゴリズム発展アルゴリズム実務のアルゴリズム
コミュニティプロジェクト開発ログプロンプトAIツールの問題ショーケースコミュニティガイド
協業技術移転ウェブサイト構築デスクトップアプリ構築リリース・決済パイプライン販売パートナーお問い合わせ
サービスリモートデスクトップインストールパッケージのカスタマイズ
TASTEDEV
製品

デスクトップツール

TASTECAD複雑な図面を、軽やかにひらくTASTEFILES必要なファイルだけを、最速でTASTEFTPファイルが行き交う、いちばん端正な道TASTESSHサーバーとあなたを、より確かにつなぐTASTEZIPより速くまとめ、より安全にひらくTASTEWINM2つの画面で整理する、キーボード中心のファイルマネージャー

開発ツール

TASTECODERust アプリの編集・ビルド・デバッグ・テストまでひとつのウィンドウでTASTESTUDIO編集からリモートテスト、承認した AI 修正までTASTEETL値を見ながら、データを運ぶ

サーバー

TASTEREMOTE自社サーバーで運用するリモートデスクトップTASTEGEOGeoServer 互換の空間情報サーバーを Rust で作り直しますTASTEMAILメールの主導権を、もう一度自分の手に

投資

TASTESTOCKいつ・何を。自分で決めたルールどおりに動く株式自動売買

はじめる

ダウンロード全製品の最新版ドキュメント各製品の使い方購入サブスクリプション・永久ライセンスすべての製品全製品を一覧で
すべての製品
マーケットプレイスニュース
技術

ニュース

今日の開発ニュース言語・フレームワーク・GitHub・AI の公式発表開発ドキュメント言語・フレームワーク・アルゴリズムのガイド

プログラミング言語

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

フレームワーク

Webフロントエンド フレームワークNext.jsReactVue.js · NuxtSvelteKitAngular
サーバー フレームワークSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
アプリ・デスクトップ フレームワークTauriFlutterReact NativeElectron

アルゴリズム

アルゴリズムの基礎計算量解析 · ソート · 探索 · 基本データ構造 · 木構造とヒープ主要アルゴリズムグラフ探索 · 最短経路と最小全域木 · 動的計画法 · 貪欲法 · 分割統治法 · バックトラッキング発展アルゴリズム文字列アルゴリズム · 数学と整数論 · ビット演算 · セグメント木 · Union-Find実務のアルゴリズムコーディング面接対策 · LRUキャッシュ · レート制限 · コンシステントハッシュ法
開発ドキュメントをすべて見る
コミュニティ
プロジェクトビルダーと作品を探す開発ログ決定と試行錯誤プロンプト再利用できる指示AIツールの問題Claude・Codex・Gemini の問題と回避策ショーケース完成した成果コミュニティガイドオープンにつくる方法
協業
技術移転Rust・egui でネイティブアプリを作るウェブサイト構築10言語、アカウント、ドキュメントとダウンロードデスクトップアプリ構築Rust・egui、WebView なしリリース・決済パイプライン署名・MSI・deb・rpm・AppImage・ハッシュ販売パートナー紹介して決済額の30%お問い合わせ構築・提携・投資のご相談
サービス
リモートデスクトップブラウザから自分のパソコンへインストールパッケージのカスタマイズ必要な機能だけ、設定は事前に
購入
JA
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
ログイン
ログイン
TASTEDEV

小さなツールから、より良い開発へ。

support@tastedev.netTASTEDEVを支援
製品製品ラインナップ購入ドキュメントダウンロードマーケットプレイスサポート
コミュニティプロジェクト開発ログプロンプトAIツールの問題ショーケース
ポリシー会社概要プライバシーポリシー利用規約サブスクリプション規約返金ポリシーコミュニティガイドライン
アカウントログイン新規登録
訪問者
今日
昨日
累計閲覧
商号
GXSOFT
代表者
CHOI YOUNG GU
事業者登録番号
853-44-00368
所在地
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
電話
+82-10-4404-1523
メール
whitecalvin@tastedev.net
個人情報保護責任者
CHOI YOUNG GU

© 2026 TASTEDEV製品情報は検証済みの開発ソースに基づいています。リリース・改善中

C ドキュメント
C
Getting StartedSyntax BasicsTypes and DataModules and LibrariesErrors and TestingKey Concepts: Pointers and Memory
ディスカッション

C ガイド · 1/6

Getting Started

この章は現在、英語でのみ提供しています。

C sits underneath a huge amount of software: operating system kernels, embedded firmware, databases, and the runtimes of many other languages. It is a compiled language, so the workflow is always the same: write source files, hand them to a compiler, and run the native executable it produces. This chapter gets a compiler onto your machine, builds a first program, turns on the warnings you want, and looks at what actually happens during a build.

Installing a compiler

There are three mainstream C compilers: GCC, Clang, and Microsoft's MSVC. Standard C code builds with any of them, so pick whichever is easiest to get on your platform.

PlatformTypical compilerHow to install
Ubuntu / DebianGCCsudo apt install build-essential
FedoraGCCsudo dnf install gcc make
macOSClangxcode-select --install (Command Line Tools)
WindowsMSVCVisual Studio or Build Tools with the "Desktop development with C++" workload
WindowsGCCMSYS2, installing the GCC package for the UCRT64 environment

Confirm the compiler is on your PATH:

gcc --version
clang --version
# MSVC: run inside a "Developer Command Prompt"
cl

MSVC needs a set of environment variables that plain terminals do not have, so use the Developer Command Prompt (or Developer PowerShell) that Visual Studio installs.

Your first program

Save this as hello.c:

#include <stdio.h>

int main(void) {
    printf("Hello, C!\n");
    return 0;
}

The #include line pulls in the declarations for the standard I/O functions. Every program starts executing in main, and the value it returns becomes the process exit status, where 0 means success.

Build and run it:

# GCC or Clang
gcc -std=c17 -Wall -Wextra -g hello.c -o hello
./hello
echo $?    # prints the exit status, 0

# MSVC (Developer Command Prompt)
cl /std:c17 /W4 hello.c
hello.exe

-o hello names the output; without it GCC and Clang write a.out. -std=c17 pins the language standard so you are not relying on whatever default the compiler picked, and -g embeds debug information for tools like GDB or LLDB. Add an optimization level such as -O2 for release builds.

Turn the warnings up

この章について質問がありますか?
次の章Syntax Basics

Out of the box, C compilers accept a lot of code that is almost certainly wrong. Enabling warnings costs nothing and catches real bugs, so make it a habit from day one.

  • -Wall enables a broad set of common-mistake warnings. Despite the name, it is not every warning.
  • -Wextra adds more checks on top, such as unused parameters.
  • -Wpedantic flags compiler extensions that are not part of standard C.
  • -Werror turns warnings into errors, which is handy in CI so warnings never pile up.
  • On MSVC, /W4 is the rough equivalent and /WX treats warnings as errors.

This program compiles, but it contains two mistakes:

#include <stdio.h>

int area(int width, int height) {
    return width * width;   /* height is never used */
}

int main(void) {
    printf("%d\n", 3.5);    /* passes a double to %d */
    return area(2, 3) == 4 ? 0 : 1;
}

With -Wall -Wextra, the compiler reports the format/argument mismatch in printf and the unused height parameter. Without warnings, you would only find out at run time through a nonsensical value.

What a build really does

That single gcc hello.c -o hello command runs four stages in sequence:

  1. Preprocessing: pastes in #include files, expands #define macros, and resolves #if conditionals.
  2. Compilation: translates the preprocessed C into assembly. Syntax errors and most warnings come from here.
  3. Assembly: turns assembly into an object file (.o, or .obj on Windows) containing machine code.
  4. Linking: combines object files and libraries into an executable. "undefined reference" errors come from this stage.

You can stop after each stage and inspect the output:

gcc -E hello.c -o hello.i   # preprocessed source
gcc -S hello.i -o hello.s   # assembly
gcc -c hello.s -o hello.o   # object file
gcc hello.o -o hello        # link

Real projects compile each source file to an object file with -c and link them all at the end. Only files that changed need recompiling, which keeps builds fast. Chapter 4 builds on this with Make and CMake.

Summary

  • Install GCC, Clang, or MSVC and verify it with --version.
  • Execution starts in main; returning 0 signals success.
  • Build with -std=c17 -Wall -Wextra (or /W4 on MSVC) so the compiler catches mistakes early.
  • A build is preprocess, compile, assemble, link. Knowing which stage produced an error tells you where to look.

コメント 0件

人気のコメント順新しい順

ログイン · ログインするとコメントできます。