目次###
順序................................................. ................................................................... ................................................................................... .....................5
はじめに...................................................................................... ................................................................... ...... ........................................7###
謝辞................................................................................ ...................................................................... ……………………………… ...................9
第 1 章 C/C 言語の概要 .................................................................................... ................................................................... ......................................10
1.1 プログラムの基本枠組み .................................................................................... ................................................................... ......................10
1.2 変数................................................................................................ ................................................................... ......................................................11
1.2.1 変数の定義................................................................................................ ................................................................... ……………………11
1.2.2 変数の割り当て................................................................................ ...................................................................... ...................................................11
1.2.3 変数の参照................................................................................................................ ................................................................... ……………………12
1.3 C/C言語のデータ型 .................................................................................... ................................................................... ......................................12
1.4 定数................................................................................ ................................................................... ...................................................................14
1.5 演算子と式 ................................................................................... ................................................................... ......................................15
1.5.1 算術演算子................................................................................ ................................................................... ...................................................15
1.5.2 代入演算子................................................................ ................................................................... ...................................................17
1.5.3 関係演算子................................................................................ ................................................................... ...................................................17
1.5.4 論理演算子................................................................ ................................................................... ....................................17
1.5.5 ビット演算子................................................................ ................................................................... ...................................................18
1.6 注意事項................................................................................................ ................................................................... ....... ...............................22###
1.7 分岐ステートメント................................................................................ ................................................................. ................ .........................23###
1.7.1 if ステートメント................................................................ ................................................................... .................. .................23###1.7.2 switch ステートメント................................................................ ................................................................... .................. ...........24###
1.8 ループ文................................................................... ................................................................. ...................................26
1.8.1 for ステートメント................................................................ ................................................................... ...................................................27
1.8.2 while 文................................................................ ................................................................... ...................................28
1.8.3 do-while ステートメント................................................................................ ................................................................... ……………………28
1.8.4 Break ステートメント................................................. ................................................................... ....................................29
1.8.5 continue ステートメント................................................... ................................................................... ...................................................30
1.9 機能................................................................................ ...................................................................... …………………………………… 30
1.9.1 関数の定義 ................................................................................... ................................................................... ……………………31
1.9.2 関数呼び出し................................................................................ ................................................................... ………… ……32
1.9.3 パラメータの受け渡しと戻り値 ................................................................... ................................................................... .... ...32
1.9.4 ライブラリ関数とヘッダー ファイル .................................................................... ................................................................... ......................................33
1.10 標準入出力................................................................................................ ................................................................... ......................................33
1.10.1 printf関数(標準出力関数)................................................................ ...................................34
1.10.2 scanf関数(標準入力関数) ................................................... ...................................35
1.11 グローバル変数とローカル変数................................................................................................................ ................................................................... ……………………35
1.12 配列................................................................ ................................................................... ...................................................................37
1.12.1 1 次元配列................................................................ ...................................................................... ...................................................37
1.12.2 2 次元配列................................................................ ...................................................................... ...................................................39
1.12.3 配列の初期化................................................................ ...................................................................... ...................................................40
1.12.4 範囲外の配列................................................................................................ ................................................................... ......................................41
1.13 文字列................................................................ ................................................................... ....................................................41
声明:
当サイトのすべてのリソースはネットユーザーが投稿したり、各ダウンロードステーションを転載したりしているので、ソフトウェアの完全性を自分でチェックしてください!当サイトのすべてのリソースは学習と参考のためだけに使用されます。ビジネス用途には使用しないでください。そうしないと、発生したすべての結果はあなた自身が負担します!権利侵害がある場合は、次の連絡先に連絡してください。admin@php.cn