Last active
December 19, 2015 05:59
-
-
Save taroyabuki/5908017 to your computer and use it in GitHub Desktop.
Literate Programming
This file contains 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
@*The first C program. | |
``\.{hello, world!}''と出力するC言語のプログラムは以下のとおり。 | |
@c | |
@<Header files to include@>@/ | |
@<The main program@> | |
@ 標準入出力のためのライブラリを利用するようにコンパイラに指示する。 | |
@<Header...@>= | |
#include <stdio.h> | |
@ |main|関数を、引数の無い関数として定義する。関数内の文は、波括弧の間に記述する。 | |
@<The main...@>= | |
main() | |
{ | |
@<Print out characters@>; | |
} | |
@ |printf|という名前を使って関数を呼び出す。この関数は、引数として与えられた文字列を表示する。文字列(リテラル)は2重引用符で囲う。 | |
@<Print out...@>= | |
printf("hello, world\n"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment