-
Notifications
You must be signed in to change notification settings - Fork 7
k23118 Miki #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Open
k23118 Miki #6
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e7ef244
add:05--基本構文の作成
yu-jimk 3ef116f
add:06--出力の作成
yu-jimk 6977f25
add:07--変数と型の作成
yu-jimk 0233b38
add:08--四則演算の作成
yu-jimk 0ae5400
add:09--入力の作成
yu-jimk 1d45249
add:10--ビット演算の作成
yu-jimk 7d452a6
update:修正点もとに変更
yu-jimk 15c7c33
fix:ダークモード対応のために数式画像差し替え
yu-jimk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
public/calc_pra2.drawio.svg
Binary file added
public/output_mkfile.mp4
Binary file not shown.
Binary file added
public/output_terminal.mp4
Binary file not shown.
39 changes: 39 additions & 0 deletions
src/content/docs/textbook/c-lang/beginner/05--syntax.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| --- | ||
| title : 基本構文 | ||
| description: C言語の構文について解説する。 | ||
| slug: textbook/c-lang/beginner/syntax | ||
| --- | ||
|
|
||
| ## C言語の基本構文 | ||
|
|
||
| --- | ||
|
|
||
| C言語でプログラムを書くときは、決まった形に従う必要がある。 | ||
| 以下のコードが、C言語の基本となるプログラムの形だ。 | ||
|
|
||
| ```c | ||
| #include <stdio.h> | ||
|
|
||
| int main(void) { | ||
| return 0; | ||
| } | ||
| ``` | ||
|
|
||
| このコードを1行ずつ解説する。 | ||
|
|
||
| ### 1. `#include <stdio.h>` | ||
|
|
||
| この行は「**標準入力・出力**」を使えるようにする命令だ。 | ||
| 標準入力・出力とは「画面に文字を表示する」や「キーボードからの入力を受け取る」機能のことである。 | ||
| `#include` は「あるプログラムを追加する」と宣言する命令で、`<stdio.h>` という「標準入力・出力の機能が入ったファイル」を取り込んでいる。 | ||
|
|
||
| ### 2. `int main(void) { ... }` | ||
|
|
||
| `main` は「**プログラムのスタート地点**」である。 | ||
| プログラムを実行すると、**必ず `main` の`{ }`の中に書かれた命令が上から順番に実行される**。 | ||
| `int` というのはこの `main` の「戻り値の型」を表しており、「整数を返す」という意味がある。 | ||
|
|
||
| ### 3. `return 0;` | ||
|
|
||
| `return 0;` は「**プログラムが正常に終わった**」ことを伝えるための命令である。 | ||
| C言語では最後に `return 0;` を書いておくのがルールである。 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.