0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

プログラム入門!!c言語の#includeの意味とは??

Posted at

C言語の#includeの意味を完全に理解!!

今回の目標

C言語を始めてみるとよくわからない#include <stdio.h>のようなプログラムの冒頭に記述されてるものを完全に理化しすること。


includeとはなに?

includeとは英語で「含む」という意味があります。
そのため#include <stdio.h>というのは「stdio.hを含む」という意味合いになります。
難しく考える必要はなく、そこに記述されているものがその行にコピーされていると考えてください。
stdio.hはC言語のライブラリ(関数の倉庫のようなもの)のことで、printfなどの標準な関数の一覧が含まれています。逆に言えば#include <stdio.h>がなければ関数printfは利用できないということになります。

main.c
#include <stdio.h>

printf("Hello World\n")

ほかにも#include "関数名"のように自分で作成した関数も呼び出すことができますが、今回はここだけ抑えることができればいいと思います。

まとめ

#include <stdio.h>はその行に標準で搭載されている関数の一覧があるようなもの。
#include "関数名"で自分が作成した関数も呼び出すことができること。

わからないことや誤りがあったらどんどんメッセージください!

0
0
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?