Full Code of demon90s/CppStudy for AI

master f3dc951b77bd cached
2098 files
1.2 MB
585.1k tokens
2379 symbols
1 requests
Download .txt
Showing preview only (2,189K chars total). Download the full file or copy to clipboard to get everything.
Repository: demon90s/CppStudy
Branch: master
Commit: f3dc951b77bd
Files: 2098
Total size: 1.2 MB

Directory structure:
gitextract_nd2mxzgw/

├── .gitignore
├── auto_refresh_mkdocs_site.sh
├── codes/
│   ├── CProgramming/
│   │   ├── README.md
│   │   ├── ch02_C语言基本概念/
│   │   │   ├── build.sh
│   │   │   ├── celsius.c
│   │   │   ├── dweight.c
│   │   │   ├── dweight2.c
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.c
│   │   │   ├── ex_09.md
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.md
│   │   │   ├── ex_12.md
│   │   │   ├── ex_13.md
│   │   │   └── pun.c
│   │   ├── ch03_格式化的输入输出/
│   │   │   ├── addfrac.c
│   │   │   ├── build.sh
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.c
│   │   │   ├── example_escape_sequence.c
│   │   │   ├── example_scanf.c
│   │   │   ├── stocks.c
│   │   │   └── tprintf.c
│   │   ├── ch04_表达式/
│   │   │   ├── build.sh
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.c
│   │   │   ├── ex_09.md
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.md
│   │   │   └── upc.c
│   │   ├── ch05_选择语句/
│   │   │   ├── broker.c
│   │   │   ├── build.sh
│   │   │   ├── date.c
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.c
│   │   │   ├── ex_09.c
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.c
│   │   │   ├── ex_12.c
│   │   │   ├── ex_13.c
│   │   │   ├── ex_14.c
│   │   │   ├── ex_15.c
│   │   │   └── ex_16.c
│   │   ├── ch06_循环/
│   │   │   ├── build.sh
│   │   │   ├── checking.c
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.c
│   │   │   ├── ex_09.c
│   │   │   ├── ex_10.md
│   │   │   ├── ex_11.md
│   │   │   ├── ex_12.c
│   │   │   ├── ex_13.c
│   │   │   ├── ex_14.c
│   │   │   ├── ex_15.c
│   │   │   ├── ex_16.md
│   │   │   ├── example_goto.c
│   │   │   ├── numdigit.c
│   │   │   ├── square.c
│   │   │   ├── square2.c
│   │   │   ├── square3.c
│   │   │   └── sum.c
│   │   ├── ch07_基本类型/
│   │   │   ├── build.sh
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.md
│   │   │   ├── ex_08.c
│   │   │   ├── ex_09.c
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.c
│   │   │   ├── ex_12.c
│   │   │   ├── ex_13.md
│   │   │   ├── ex_15.md
│   │   │   ├── ex_16.md
│   │   │   ├── ex_17.c
│   │   │   ├── ex_18.md
│   │   │   ├── ex_19.c
│   │   │   ├── length.c
│   │   │   ├── mytoupper.c
│   │   │   ├── scanf_char.c
│   │   │   ├── sum2.c
│   │   │   └── typedef_sizeof.c
│   │   ├── ch08_数组/
│   │   │   ├── build.sh
│   │   │   ├── deal.c
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.md
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.md
│   │   │   ├── ex_09.c
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.c
│   │   │   ├── ex_12.c
│   │   │   ├── ex_13.c
│   │   │   ├── interest.c
│   │   │   ├── repdigit.c
│   │   │   └── reverse.c
│   │   ├── ch09_函数/
│   │   │   ├── average.c
│   │   │   ├── build.sh
│   │   │   ├── countdown.c
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.md
│   │   │   ├── ex_09.c
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.md
│   │   │   ├── ex_12.c
│   │   │   ├── ex_13.c
│   │   │   ├── ex_14.c
│   │   │   ├── ex_15.c
│   │   │   ├── ex_16.c
│   │   │   ├── ex_17.c
│   │   │   ├── prime.c
│   │   │   ├── pun2.c
│   │   │   └── qsort.c
│   │   ├── ch10_程序结构/
│   │   │   ├── build.sh
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.md
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── guess.c
│   │   │   ├── poker.c
│   │   │   └── stack.c
│   │   ├── ch11_指针/
│   │   │   ├── build.sh
│   │   │   ├── ex_01.md
│   │   │   ├── ex_02.md
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   └── maxmin.c
│   │   ├── ch12_指针和数组/
│   │   │   ├── build.sh
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.md
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.md
│   │   │   ├── ex_08.md
│   │   │   ├── ex_09.md
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.c
│   │   │   ├── ex_12.c
│   │   │   ├── ex_13.c
│   │   │   ├── ex_14.c
│   │   │   ├── ex_15.c
│   │   │   └── reverse2.c
│   │   ├── ch13_字符串/
│   │   │   ├── build.sh
│   │   │   ├── count_space.c
│   │   │   ├── ex_01.md
│   │   │   ├── ex_02.md
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.c
│   │   │   ├── ex_09.md
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.c
│   │   │   ├── ex_12.md
│   │   │   ├── ex_13.c
│   │   │   ├── ex_14.c
│   │   │   ├── ex_15.c
│   │   │   ├── ex_16.c
│   │   │   ├── ex_17.c
│   │   │   ├── ex_18.md
│   │   │   ├── ex_19.c
│   │   │   ├── ex_20.c
│   │   │   ├── planet.c
│   │   │   ├── read_line.c
│   │   │   ├── remind.c
│   │   │   ├── reverse.c
│   │   │   ├── strcat.c
│   │   │   ├── strcmp.c
│   │   │   └── strlen.c
│   │   ├── ch14_预处理器/
│   │   │   ├── build.sh
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.c
│   │   │   ├── ex_09.c
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.c
│   │   │   └── ex_12.c
│   │   ├── ch15_编写大规模程序/
│   │   │   ├── build.sh
│   │   │   ├── dir_ex_04/
│   │   │   │   ├── bar.c
│   │   │   │   ├── foo.c
│   │   │   │   └── makefile
│   │   │   ├── dir_ex_06/
│   │   │   │   ├── main.c
│   │   │   │   ├── makefile
│   │   │   │   ├── stack.c
│   │   │   │   ├── stack.h
│   │   │   │   ├── token.c
│   │   │   │   └── token.h
│   │   │   ├── dir_ex_07/
│   │   │   │   ├── f1.c
│   │   │   │   ├── f1.h
│   │   │   │   ├── f2.c
│   │   │   │   ├── f2.h
│   │   │   │   ├── main.c
│   │   │   │   └── makefile
│   │   │   ├── ex_01.md
│   │   │   ├── ex_02.md
│   │   │   ├── ex_03.md
│   │   │   ├── ex_04.md
│   │   │   ├── ex_05.md
│   │   │   ├── ex_06.md
│   │   │   ├── ex_07.md
│   │   │   ├── ex_08.md
│   │   │   ├── ex_09.md
│   │   │   └── format_program/
│   │   │       ├── fmt.c
│   │   │       ├── line.c
│   │   │       ├── line.h
│   │   │       ├── makefile
│   │   │       ├── quote
│   │   │       ├── word.c
│   │   │       ├── word.h
│   │   │       └── 核心伪代码.txt
│   │   ├── ch16_结构_联合_枚举/
│   │   │   ├── build.sh
│   │   │   ├── dir_ex_08/
│   │   │   │   ├── invent.c
│   │   │   │   ├── makefile
│   │   │   │   ├── readline.c
│   │   │   │   └── readline.h
│   │   │   ├── dir_ex_09/
│   │   │   │   ├── invent.c
│   │   │   │   ├── makefile
│   │   │   │   ├── readline.c
│   │   │   │   └── readline.h
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_04.md
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.md
│   │   │   ├── ex_08.md
│   │   │   ├── ex_09.md
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.c
│   │   │   ├── ex_12.c
│   │   │   ├── ex_13.md
│   │   │   ├── ex_14.c
│   │   │   ├── ex_15.md
│   │   │   ├── ex_16.md
│   │   │   ├── ex_17.c
│   │   │   └── program_parts/
│   │   │       ├── invent.c
│   │   │       ├── makefile
│   │   │       ├── readline.c
│   │   │       └── readline.h
│   │   ├── ch17_指针的高级应用/
│   │   │   ├── build.sh
│   │   │   ├── dir_ex_04/
│   │   │   │   ├── invent.c
│   │   │   │   ├── makefile
│   │   │   │   ├── readline.c
│   │   │   │   └── readline.h
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.md
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.md
│   │   │   ├── ex_08.md
│   │   │   ├── ex_09.md
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.md
│   │   │   ├── ex_12.c
│   │   │   ├── ex_13.c
│   │   │   ├── ex_14.c
│   │   │   ├── ex_15.md
│   │   │   ├── ex_16.md
│   │   │   ├── ex_17.c
│   │   │   ├── list/
│   │   │   │   ├── list.c
│   │   │   │   ├── list.h
│   │   │   │   ├── main.c
│   │   │   │   └── makefile
│   │   │   ├── program_parts/
│   │   │   │   ├── invent.c
│   │   │   │   ├── makefile
│   │   │   │   ├── readline.c
│   │   │   │   └── readline.h
│   │   │   ├── remind2.c
│   │   │   └── tabulate.c
│   │   ├── ch18_声明/
│   │   │   ├── build.sh
│   │   │   ├── ex_01.md
│   │   │   ├── ex_02.md
│   │   │   ├── ex_03.md
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.md
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.c
│   │   │   ├── ex_09.c
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.c
│   │   │   ├── ex_12.md
│   │   │   └── example_register.c
│   │   ├── ch19_程序设计/
│   │   │   ├── build.sh
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.md
│   │   │   ├── ex_03.md
│   │   │   ├── ex_04.md
│   │   │   ├── ex_05.md
│   │   │   ├── ex_06.md
│   │   │   ├── ex_07.cpp
│   │   │   ├── ex_08.md
│   │   │   ├── ex_09.md
│   │   │   ├── ex_10.md
│   │   │   ├── queue/
│   │   │   │   ├── main.c
│   │   │   │   ├── makefile
│   │   │   │   ├── queue.h
│   │   │   │   ├── queue_impl1.c
│   │   │   │   └── queue_impl2.c
│   │   │   ├── queue2/
│   │   │   │   ├── main.c
│   │   │   │   ├── makefile
│   │   │   │   ├── queue.c
│   │   │   │   └── queue.h
│   │   │   ├── queue3/
│   │   │   │   ├── main.cpp
│   │   │   │   ├── makefile
│   │   │   │   ├── queue.cpp
│   │   │   │   └── queue.h
│   │   │   ├── queue4/
│   │   │   │   ├── main.cpp
│   │   │   │   ├── makefile
│   │   │   │   ├── queue.cpp
│   │   │   │   └── queue.h
│   │   │   └── stack/
│   │   │       ├── main.c
│   │   │       ├── makefile
│   │   │       ├── stack.c
│   │   │       └── stack.h
│   │   ├── ch20_低级程序设计/
│   │   │   ├── build.sh
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.c
│   │   │   ├── ex_09.c
│   │   │   ├── ex_10.c
│   │   │   ├── test_bit_field.c
│   │   │   └── xor.c
│   │   ├── ch21_标准库/
│   │   │   ├── build.sh
│   │   │   ├── ex_01.md
│   │   │   ├── ex_02.md
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.md
│   │   │   └── ex_05.c
│   │   ├── ch22_输入_输出/
│   │   │   ├── build.sh
│   │   │   ├── canopen.c
│   │   │   ├── dir_ex_19/
│   │   │   │   ├── invent.c
│   │   │   │   ├── makefile
│   │   │   │   ├── readline.c
│   │   │   │   └── readline.h
│   │   │   ├── dir_ex_21/
│   │   │   │   ├── invent.c
│   │   │   │   ├── makefile
│   │   │   │   ├── readline.c
│   │   │   │   └── readline.h
│   │   │   ├── ex_01.md
│   │   │   ├── ex_02.md
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.c
│   │   │   ├── ex_09.c
│   │   │   ├── ex_10.md
│   │   │   ├── ex_11.md
│   │   │   ├── ex_12.c
│   │   │   ├── ex_13.c
│   │   │   ├── ex_14.c
│   │   │   ├── ex_15.c
│   │   │   ├── ex_16.c
│   │   │   ├── ex_17.c
│   │   │   ├── ex_18.c
│   │   │   ├── ex_19.md
│   │   │   ├── ex_20.c
│   │   │   ├── ex_21.md
│   │   │   ├── ex_22.c
│   │   │   ├── ex_23.c
│   │   │   ├── fcopy.c
│   │   │   ├── invclear.c
│   │   │   ├── invent
│   │   │   ├── invent.rle
│   │   │   └── test_enter.c
│   │   ├── ch23_库对数值和字符数据的支持/
│   │   │   ├── build.sh
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.c
│   │   │   ├── ex_09.md
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.c
│   │   │   ├── ex_12.c
│   │   │   ├── ex_13.c
│   │   │   └── tcasemap.c
│   │   ├── ch24_错误处理/
│   │   │   ├── build.sh
│   │   │   ├── dir_ex_04/
│   │   │   │   ├── invent.c
│   │   │   │   ├── makefile
│   │   │   │   ├── readline.c
│   │   │   │   └── readline.h
│   │   │   ├── ex_01.md
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.md
│   │   │   ├── tsetjmp.c
│   │   │   └── tsignal.c
│   │   ├── ch25_国际化特性/
│   │   │   ├── build.sh
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   └── ex_04.md
│   │   ├── ch26_其他库函数/
│   │   │   ├── airmiles.c
│   │   │   ├── build.sh
│   │   │   ├── datetime.c
│   │   │   ├── errorf.c
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.c
│   │   │   ├── ex_09.c
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.c
│   │   │   ├── ex_12.c
│   │   │   ├── ex_13.c
│   │   │   ├── ex_14.c
│   │   │   ├── max_int.c
│   │   │   ├── trand.c
│   │   │   └── tstrconv.c
│   │   └── gen_readme.sh
│   └── CppPrimer/
│       ├── README.md
│       ├── build_all.sh
│       ├── ch01_Getting_Started/
│       │   ├── Sales_item.h
│       │   ├── build.sh
│       │   ├── data/
│       │   │   ├── add_item
│       │   │   └── book_sales
│       │   ├── example_comments.cpp
│       │   ├── example_for.cpp
│       │   ├── example_if.cpp
│       │   ├── example_iostream.cpp
│       │   ├── example_main.cpp
│       │   ├── example_while.cpp
│       │   ├── exercise_1_01.cpp
│       │   ├── exercise_1_02.cpp
│       │   ├── exercise_1_03.cpp
│       │   ├── exercise_1_04.cpp
│       │   ├── exercise_1_05.cpp
│       │   ├── exercise_1_06.cpp
│       │   ├── exercise_1_07.cpp
│       │   ├── exercise_1_08.cpp
│       │   ├── exercise_1_09.cpp
│       │   ├── exercise_1_10.cpp
│       │   ├── exercise_1_11.cpp
│       │   ├── exercise_1_12.cpp
│       │   ├── exercise_1_13.cpp
│       │   ├── exercise_1_14.cpp
│       │   ├── exercise_1_15.cpp
│       │   ├── exercise_1_16.cpp
│       │   ├── exercise_1_17.cpp
│       │   ├── exercise_1_18.cpp
│       │   ├── exercise_1_19.cpp
│       │   ├── exercise_1_20.cpp
│       │   ├── exercise_1_21.cpp
│       │   ├── exercise_1_22.cpp
│       │   ├── exercise_1_23.cpp
│       │   ├── exercise_1_24.cpp
│       │   ├── exercise_1_25.cpp
│       │   ├── test_clog.cpp
│       │   ├── usage_Sales_item_avg_price.cpp
│       │   ├── usage_add_Sales_item.cpp
│       │   └── usage_read_inputs.cpp
│       ├── ch02_Variables_and_Basic_Types/
│       │   ├── Sales_data.h
│       │   ├── build.sh
│       │   ├── data/
│       │   │   ├── add_item
│       │   │   └── book_sales
│       │   ├── exercise_2_01.txt
│       │   ├── exercise_2_02.txt
│       │   ├── exercise_2_03.txt
│       │   ├── exercise_2_04.cpp
│       │   ├── exercise_2_05.txt
│       │   ├── exercise_2_06.cpp
│       │   ├── exercise_2_07.cpp
│       │   ├── exercise_2_08.cpp
│       │   ├── exercise_2_09.cpp
│       │   ├── exercise_2_10.cpp
│       │   ├── exercise_2_11.txt
│       │   ├── exercise_2_12.txt
│       │   ├── exercise_2_13.cpp
│       │   ├── exercise_2_14.cpp
│       │   ├── exercise_2_15.txt
│       │   ├── exercise_2_16.cpp
│       │   ├── exercise_2_17.cpp
│       │   ├── exercise_2_18.cpp
│       │   ├── exercise_2_19.txt
│       │   ├── exercise_2_20.cpp
│       │   ├── exercise_2_21.txt
│       │   ├── exercise_2_22.txt
│       │   ├── exercise_2_23.txt
│       │   ├── exercise_2_24.txt
│       │   ├── exercise_2_25.txt
│       │   ├── exercise_2_26.txt
│       │   ├── exercise_2_27.cpp
│       │   ├── exercise_2_28.txt
│       │   ├── exercise_2_29.txt
│       │   ├── exercise_2_30.txt
│       │   ├── exercise_2_31.txt
│       │   ├── exercise_2_32.txt
│       │   ├── exercise_2_33.txt
│       │   ├── exercise_2_34.cpp
│       │   ├── exercise_2_35.cpp
│       │   ├── exercise_2_36.cpp
│       │   ├── exercise_2_37.txt
│       │   ├── exercise_2_38.md
│       │   ├── exercise_2_39.cpp
│       │   ├── exercise_2_40.cpp
│       │   ├── exercise_2_41.cpp
│       │   ├── exercise_2_42.cpp
│       │   ├── test_char.cpp
│       │   ├── test_list_initialization.cpp
│       │   └── test_literal.cpp
│       ├── ch03_Strings_Vectors_and_Arrays/
│       │   ├── build.sh
│       │   ├── example_getline.cpp
│       │   ├── example_normal_array_simulate_dimensional_array.cpp
│       │   ├── example_push_back.cpp
│       │   ├── example_range_for.cpp
│       │   ├── example_read_string.cpp
│       │   ├── example_using_iterators.cpp
│       │   ├── example_using_subscript.cpp
│       │   ├── exercise_3_01.cpp
│       │   ├── exercise_3_02.cpp
│       │   ├── exercise_3_03.txt
│       │   ├── exercise_3_04a.cpp
│       │   ├── exercise_3_04b.cpp
│       │   ├── exercise_3_05a.cpp
│       │   ├── exercise_3_05b.cpp
│       │   ├── exercise_3_06.cpp
│       │   ├── exercise_3_07.cpp
│       │   ├── exercise_3_08a.cpp
│       │   ├── exercise_3_08b.cpp
│       │   ├── exercise_3_09.txt
│       │   ├── exercise_3_10.cpp
│       │   ├── exercise_3_11.txt
│       │   ├── exercise_3_12.txt
│       │   ├── exercise_3_13.cpp
│       │   ├── exercise_3_14.cpp
│       │   ├── exercise_3_15.cpp
│       │   ├── exercise_3_16.cpp
│       │   ├── exercise_3_17.cpp
│       │   ├── exercise_3_18.txt
│       │   ├── exercise_3_19.cpp
│       │   ├── exercise_3_20a.cpp
│       │   ├── exercise_3_20b.cpp
│       │   ├── exercise_3_21.cpp
│       │   ├── exercise_3_22.cpp
│       │   ├── exercise_3_23.cpp
│       │   ├── exercise_3_24a.cpp
│       │   ├── exercise_3_24b.cpp
│       │   ├── exercise_3_25.cpp
│       │   ├── exercise_3_26.txt
│       │   ├── exercise_3_27.txt
│       │   ├── exercise_3_28.cpp
│       │   ├── exercise_3_29.txt
│       │   ├── exercise_3_30.txt
│       │   ├── exercise_3_31.cpp
│       │   ├── exercise_3_32a.cpp
│       │   ├── exercise_3_32b.cpp
│       │   ├── exercise_3_33.txt
│       │   ├── exercise_3_34.txt
│       │   ├── exercise_3_35.cpp
│       │   ├── exercise_3_36a.cpp
│       │   ├── exercise_3_36b.cpp
│       │   ├── exercise_3_37.cpp
│       │   ├── exercise_3_38.txt
│       │   ├── exercise_3_39a.cpp
│       │   ├── exercise_3_39b.cpp
│       │   ├── exercise_3_40.cpp
│       │   ├── exercise_3_41.cpp
│       │   ├── exercise_3_42.cpp
│       │   ├── exercise_3_43a.cpp
│       │   ├── exercise_3_43b.cpp
│       │   ├── exercise_3_43c.cpp
│       │   ├── exercise_3_44.cpp
│       │   ├── exercise_3_45.cpp
│       │   ├── usage_bsearch.cpp
│       │   ├── usage_count_punct_in_string.cpp
│       │   └── usage_string_toupper.cpp
│       ├── ch04_Expressions/
│       │   ├── build.sh
│       │   ├── example_comma_operator.cpp
│       │   ├── example_increment_operator.cpp
│       │   ├── exercise_4_01.txt
│       │   ├── exercise_4_02.txt
│       │   ├── exercise_4_03.txt
│       │   ├── exercise_4_04.cpp
│       │   ├── exercise_4_05.txt
│       │   ├── exercise_4_06.txt
│       │   ├── exercise_4_07.cpp
│       │   ├── exercise_4_08.txt
│       │   ├── exercise_4_09.txt
│       │   ├── exercise_4_10.cpp
│       │   ├── exercise_4_11.txt
│       │   ├── exercise_4_12.txt
│       │   ├── exercise_4_13.cpp
│       │   ├── exercise_4_14.txt
│       │   ├── exercise_4_15.txt
│       │   ├── exercise_4_16.cpp
│       │   ├── exercise_4_17.txt
│       │   ├── exercise_4_18.txt
│       │   ├── exercise_4_19.txt
│       │   ├── exercise_4_20.txt
│       │   ├── exercise_4_21.cpp
│       │   ├── exercise_4_22a.cpp
│       │   ├── exercise_4_22b.cpp
│       │   ├── exercise_4_23.cpp
│       │   ├── exercise_4_24.txt
│       │   ├── exercise_4_25.cpp
│       │   ├── exercise_4_26.txt
│       │   ├── exercise_4_27.cpp
│       │   ├── exercise_4_28.cpp
│       │   ├── exercise_4_29.cpp
│       │   ├── exercise_4_30.txt
│       │   ├── exercise_4_31.cpp
│       │   ├── exercise_4_32.txt
│       │   ├── exercise_4_33.txt
│       │   ├── exercise_4_34.txt
│       │   ├── exercise_4_35.txt
│       │   ├── exercise_4_36.txt
│       │   ├── exercise_4_37.txt
│       │   ├── exercise_4_38.txt
│       │   ├── test_bitwise_oparator.cpp
│       │   └── test_sizeof.cpp
│       ├── ch05_Statements/
│       │   ├── build.sh
│       │   ├── data/
│       │   │   └── vowels.txt
│       │   ├── example_do_while.cpp
│       │   ├── example_if_statement.cpp
│       │   ├── exercise_5_01.txt
│       │   ├── exercise_5_02.txt
│       │   ├── exercise_5_03.cpp
│       │   ├── exercise_5_04.txt
│       │   ├── exercise_5_05.cpp
│       │   ├── exercise_5_06.cpp
│       │   ├── exercise_5_07.txt
│       │   ├── exercise_5_08.txt
│       │   ├── exercise_5_09.cpp
│       │   ├── exercise_5_10.cpp
│       │   ├── exercise_5_11.cpp
│       │   ├── exercise_5_12.cpp
│       │   ├── exercise_5_13.txt
│       │   ├── exercise_5_14.cpp
│       │   ├── exercise_5_15.txt
│       │   ├── exercise_5_16a.cpp
│       │   ├── exercise_5_16b.cpp
│       │   ├── exercise_5_16c.cpp
│       │   ├── exercise_5_16d.cpp
│       │   ├── exercise_5_17.cpp
│       │   ├── exercise_5_18.txt
│       │   ├── exercise_5_19.cpp
│       │   ├── exercise_5_20.cpp
│       │   ├── exercise_5_21.cpp
│       │   ├── exercise_5_22.txt
│       │   ├── exercise_5_23.cpp
│       │   ├── exercise_5_24.cpp
│       │   └── exercise_5_25.cpp
│       ├── ch06_Functions/
│       │   ├── Chapter6.h
│       │   ├── build.sh
│       │   ├── example_array_param.cpp
│       │   ├── example_const_cast_and_overloading.cpp
│       │   ├── example_functions_with_no_return_value.cpp
│       │   ├── example_initializer_list_param.cpp
│       │   ├── example_inline_functions.cpp
│       │   ├── example_passing_a_multidimensional_array.cpp
│       │   ├── example_preprocessor_variable.cpp
│       │   ├── example_recursion.cpp
│       │   ├── example_return_from_main.cpp
│       │   ├── example_returning_a_pointer_to_an_array.cpp
│       │   ├── example_using_ref_to_avoid_cp.cpp
│       │   ├── example_using_ref_to_return_info.cpp
│       │   ├── exercise_6_01.txt
│       │   ├── exercise_6_02.txt
│       │   ├── exercise_6_03.cpp
│       │   ├── exercise_6_04.cpp
│       │   ├── exercise_6_05.cpp
│       │   ├── exercise_6_06.cpp
│       │   ├── exercise_6_07.cpp
│       │   ├── exercise_6_08.txt
│       │   ├── exercise_6_09/
│       │   │   ├── build.sh
│       │   │   ├── exercise_6_09.txt
│       │   │   ├── fact.cc
│       │   │   └── factMain.cc
│       │   ├── exercise_6_10.cpp
│       │   ├── exercise_6_11.cpp
│       │   ├── exercise_6_12.cpp
│       │   ├── exercise_6_13.txt
│       │   ├── exercise_6_14.txt
│       │   ├── exercise_6_15.txt
│       │   ├── exercise_6_16.md
│       │   ├── exercise_6_17.cpp
│       │   ├── exercise_6_18.md
│       │   ├── exercise_6_19.md
│       │   ├── exercise_6_20.md
│       │   ├── exercise_6_21.cpp
│       │   ├── exercise_6_22.cpp
│       │   ├── exercise_6_23.cpp
│       │   ├── exercise_6_24.cpp
│       │   ├── exercise_6_25.cpp
│       │   ├── exercise_6_26.cpp
│       │   ├── exercise_6_27.cpp
│       │   ├── exercise_6_28.md
│       │   ├── exercise_6_29.md
│       │   ├── exercise_6_30.cpp
│       │   ├── exercise_6_31.md
│       │   ├── exercise_6_32.md
│       │   ├── exercise_6_33.cpp
│       │   ├── exercise_6_34.cpp
│       │   ├── exercise_6_35.md
│       │   ├── exercise_6_36.cpp
│       │   ├── exercise_6_37.cpp
│       │   ├── exercise_6_38.cpp
│       │   ├── exercise_6_39.md
│       │   ├── exercise_6_40.md
│       │   ├── exercise_6_41.md
│       │   ├── exercise_6_42.cpp
│       │   ├── exercise_6_43.md
│       │   ├── exercise_6_44.cpp
│       │   ├── exercise_6_45.md
│       │   ├── exercise_6_46.cpp
│       │   ├── exercise_6_47.cpp
│       │   ├── exercise_6_48.md
│       │   ├── exercise_6_49.md
│       │   ├── exercise_6_50.md
│       │   ├── exercise_6_51.cpp
│       │   ├── exercise_6_52.md
│       │   ├── exercise_6_53.md
│       │   ├── exercise_6_54.cpp
│       │   ├── exercise_6_55.cpp
│       │   └── exercise_6_56.cpp
│       ├── ch07_Classes/
│       │   ├── build.sh
│       │   ├── data/
│       │   │   ├── add_item
│       │   │   └── book_sales
│       │   ├── example_Account/
│       │   │   ├── Account.cpp
│       │   │   ├── Account.h
│       │   │   ├── Makefile
│       │   │   └── main.cpp
│       │   ├── example_Person.cpp
│       │   ├── example_Sales_data/
│       │   │   ├── Makefile
│       │   │   ├── Sales_data.h
│       │   │   ├── exceptions.h
│       │   │   └── main.cpp
│       │   ├── example_Screen/
│       │   │   ├── Makefile
│       │   │   ├── Screen.h
│       │   │   ├── Window_mgr.h
│       │   │   └── main.cpp
│       │   ├── example_literal_classes/
│       │   │   ├── Debug.h
│       │   │   ├── Makefile
│       │   │   └── main.cpp
│       │   ├── exercise_7_01.cpp
│       │   ├── exercise_7_02.cpp
│       │   ├── exercise_7_03.cpp
│       │   ├── exercise_7_04.cpp
│       │   ├── exercise_7_05.cpp
│       │   ├── exercise_7_06.cpp
│       │   ├── exercise_7_07.cpp
│       │   ├── exercise_7_08.md
│       │   ├── exercise_7_09.cpp
│       │   ├── exercise_7_10.md
│       │   ├── exercise_7_11.cpp
│       │   ├── exercise_7_12.cpp
│       │   ├── exercise_7_13.cpp
│       │   ├── exercise_7_14.md
│       │   ├── exercise_7_15.cpp
│       │   ├── exercise_7_16.md
│       │   ├── exercise_7_17.md
│       │   ├── exercise_7_18.md
│       │   ├── exercise_7_19.cpp
│       │   ├── exercise_7_20.md
│       │   ├── exercise_7_21.md
│       │   ├── exercise_7_22.cpp
│       │   ├── exercise_7_23.cpp
│       │   ├── exercise_7_24.cpp
│       │   ├── exercise_7_25.md
│       │   ├── exercise_7_26.md
│       │   ├── exercise_7_27.cpp
│       │   ├── exercise_7_28.md
│       │   ├── exercise_7_29.cpp
│       │   ├── exercise_7_30.md
│       │   ├── exercise_7_31.cpp
│       │   ├── exercise_7_32.cpp
│       │   ├── exercise_7_33.md
│       │   ├── exercise_7_34.md
│       │   ├── exercise_7_35.cpp
│       │   ├── exercise_7_36.cpp
│       │   ├── exercise_7_37.md
│       │   ├── exercise_7_38.cpp
│       │   ├── exercise_7_39.md
│       │   ├── exercise_7_40.cpp
│       │   ├── exercise_7_41.cpp
│       │   ├── exercise_7_42.cpp
│       │   ├── exercise_7_43.cpp
│       │   ├── exercise_7_44.md
│       │   ├── exercise_7_45.md
│       │   ├── exercise_7_46.md
│       │   ├── exercise_7_47.md
│       │   ├── exercise_7_48.md
│       │   ├── exercise_7_49.md
│       │   ├── exercise_7_50.md
│       │   ├── exercise_7_51.md
│       │   ├── exercise_7_52.md
│       │   ├── exercise_7_53.md
│       │   ├── exercise_7_54.md
│       │   ├── exercise_7_55.md
│       │   ├── exercise_7_56.md
│       │   ├── exercise_7_57.md
│       │   ├── exercise_7_58.md
│       │   └── test_incomplete_type.cpp
│       ├── ch08_The_IO_Library/
│       │   ├── build.sh
│       │   ├── data/
│       │   │   ├── person_numbers.txt
│       │   │   └── some_words.txt
│       │   ├── example_fstream.cpp
│       │   ├── example_istringstream.cpp
│       │   ├── exercise_8_01.cpp
│       │   ├── exercise_8_02.md
│       │   ├── exercise_8_03.md
│       │   ├── exercise_8_04.cpp
│       │   ├── exercise_8_05.cpp
│       │   ├── exercise_8_06.cpp
│       │   ├── exercise_8_07.cpp
│       │   ├── exercise_8_08.cpp
│       │   ├── exercise_8_09.cpp
│       │   ├── exercise_8_10.cpp
│       │   ├── exercise_8_11.cpp
│       │   ├── exercise_8_12.md
│       │   ├── exercise_8_13.cpp
│       │   └── exercise_8_14.md
│       ├── ch09_Sequential_Containers/
│       │   ├── build.sh
│       │   ├── data/
│       │   │   └── letter.txt
│       │   ├── example_capacity_size.cpp
│       │   ├── example_change_container_in_loop.cpp
│       │   ├── example_erase.cpp
│       │   ├── example_forward_list.cpp
│       │   ├── example_insert.cpp
│       │   ├── example_iterator_range.cpp
│       │   ├── exercise_9_01.md
│       │   ├── exercise_9_02.cpp
│       │   ├── exercise_9_03.md
│       │   ├── exercise_9_04.cpp
│       │   ├── exercise_9_05.cpp
│       │   ├── exercise_9_06.md
│       │   ├── exercise_9_07.md
│       │   ├── exercise_9_08.md
│       │   ├── exercise_9_09.md
│       │   ├── exercise_9_10.md
│       │   ├── exercise_9_11.cpp
│       │   ├── exercise_9_12.md
│       │   ├── exercise_9_13.cpp
│       │   ├── exercise_9_14.cpp
│       │   ├── exercise_9_15.cpp
│       │   ├── exercise_9_16.cpp
│       │   ├── exercise_9_17.md
│       │   ├── exercise_9_18.cpp
│       │   ├── exercise_9_19.cpp
│       │   ├── exercise_9_20.cpp
│       │   ├── exercise_9_21.md
│       │   ├── exercise_9_22.md
│       │   ├── exercise_9_23.md
│       │   ├── exercise_9_24.cpp
│       │   ├── exercise_9_25.cpp
│       │   ├── exercise_9_26.cpp
│       │   ├── exercise_9_27.cpp
│       │   ├── exercise_9_28.cpp
│       │   ├── exercise_9_29.md
│       │   ├── exercise_9_30.md
│       │   ├── exercise_9_31.cpp
│       │   ├── exercise_9_32.md
│       │   ├── exercise_9_33.cpp
│       │   ├── exercise_9_34.cpp
│       │   ├── exercise_9_35.md
│       │   ├── exercise_9_36.md
│       │   ├── exercise_9_37.md
│       │   ├── exercise_9_38.cpp
│       │   ├── exercise_9_39.md
│       │   ├── exercise_9_40.cpp
│       │   ├── exercise_9_41.cpp
│       │   ├── exercise_9_42.md
│       │   ├── exercise_9_43.cpp
│       │   ├── exercise_9_44.cpp
│       │   ├── exercise_9_45.cpp
│       │   ├── exercise_9_46.cpp
│       │   ├── exercise_9_47.cpp
│       │   ├── exercise_9_48.cpp
│       │   ├── exercise_9_49.cpp
│       │   ├── exercise_9_50.cpp
│       │   ├── exercise_9_51.cpp
│       │   └── exercise_9_52.cpp
│       ├── ch10_Generic_Algorithms/
│       │   ├── build.sh
│       │   ├── example_back_inserter.cpp
│       │   ├── example_istream_iterator.cpp
│       │   ├── example_lambda.cpp
│       │   ├── example_ostream_iterator.cpp
│       │   ├── example_stable_partition.cpp
│       │   ├── example_stable_sort.cpp
│       │   ├── example_unique.cpp
│       │   ├── exercise_10_01.cpp
│       │   ├── exercise_10_02.cpp
│       │   ├── exercise_10_03.cpp
│       │   ├── exercise_10_04.cpp
│       │   ├── exercise_10_05.md
│       │   ├── exercise_10_06.cpp
│       │   ├── exercise_10_07.md
│       │   ├── exercise_10_08.md
│       │   ├── exercise_10_09.cpp
│       │   ├── exercise_10_10.md
│       │   ├── exercise_10_11.cpp
│       │   ├── exercise_10_12.cpp
│       │   ├── exercise_10_13.cpp
│       │   ├── exercise_10_14.cpp
│       │   ├── exercise_10_15.cpp
│       │   ├── exercise_10_16.cpp
│       │   ├── exercise_10_17.cpp
│       │   ├── exercise_10_18.cpp
│       │   ├── exercise_10_19.cpp
│       │   ├── exercise_10_20.cpp
│       │   ├── exercise_10_21.cpp
│       │   ├── exercise_10_22.cpp
│       │   ├── exercise_10_23.md
│       │   ├── exercise_10_24.cpp
│       │   ├── exercise_10_25.cpp
│       │   ├── exercise_10_26.md
│       │   ├── exercise_10_27.cpp
│       │   ├── exercise_10_28.cpp
│       │   ├── exercise_10_29.cpp
│       │   ├── exercise_10_30.cpp
│       │   ├── exercise_10_31.cpp
│       │   ├── exercise_10_32.cpp
│       │   ├── exercise_10_33.cpp
│       │   ├── exercise_10_34.cpp
│       │   ├── exercise_10_35.cpp
│       │   ├── exercise_10_36.cpp
│       │   ├── exercise_10_37.cpp
│       │   ├── exercise_10_38.md
│       │   ├── exercise_10_39.md
│       │   ├── exercise_10_40.md
│       │   ├── exercise_10_41.md
│       │   └── exercise_10_42.cpp
│       ├── ch11_Associative_Containers/
│       │   ├── build.sh
│       │   ├── data/
│       │   │   ├── test_rules.txt
│       │   │   └── trans_rules.txt
│       │   ├── example_init_multiset.cpp
│       │   ├── example_make_pair.cpp
│       │   ├── example_map.cpp
│       │   ├── example_multimap_find.cpp
│       │   ├── example_set.cpp
│       │   ├── example_unordered_set.cpp
│       │   ├── example_word_transform.cpp
│       │   ├── exercise_11_01.md
│       │   ├── exercise_11_02.md
│       │   ├── exercise_11_03.cpp
│       │   ├── exercise_11_04.cpp
│       │   ├── exercise_11_05.md
│       │   ├── exercise_11_06.md
│       │   ├── exercise_11_07.cpp
│       │   ├── exercise_11_08.cpp
│       │   ├── exercise_11_09.cpp
│       │   ├── exercise_11_10.md
│       │   ├── exercise_11_11.cpp
│       │   ├── exercise_11_12.cpp
│       │   ├── exercise_11_13.cpp
│       │   ├── exercise_11_14.cpp
│       │   ├── exercise_11_15.md
│       │   ├── exercise_11_16.md
│       │   ├── exercise_11_17.cpp
│       │   ├── exercise_11_18.md
│       │   ├── exercise_11_19.cpp
│       │   ├── exercise_11_20.cpp
│       │   ├── exercise_11_21.md
│       │   ├── exercise_11_22.md
│       │   ├── exercise_11_23.cpp
│       │   ├── exercise_11_24.md
│       │   ├── exercise_11_25.md
│       │   ├── exercise_11_26.md
│       │   ├── exercise_11_27.md
│       │   ├── exercise_11_28.cpp
│       │   ├── exercise_11_29.md
│       │   ├── exercise_11_30.md
│       │   ├── exercise_11_31.cpp
│       │   ├── exercise_11_32.cpp
│       │   ├── exercise_11_33.cpp
│       │   ├── exercise_11_34.md
│       │   ├── exercise_11_35.md
│       │   ├── exercise_11_36.md
│       │   ├── exercise_11_37.md
│       │   └── exercise_11_38.cpp
│       ├── ch12_Dynamic_Memory/
│       │   ├── build.sh
│       │   ├── example_StrBlob/
│       │   │   ├── Makefile
│       │   │   ├── StrBlob.cpp
│       │   │   ├── StrBlob.h
│       │   │   └── main.cpp
│       │   ├── example_StrBlobPtr/
│       │   │   ├── ConstStrBlobPtr.cpp
│       │   │   ├── ConstStrBlobPtr.h
│       │   │   ├── Makefile
│       │   │   ├── StrBlob.cpp
│       │   │   ├── StrBlob.h
│       │   │   ├── StrBlobPtr.cpp
│       │   │   ├── StrBlobPtr.h
│       │   │   └── main.cpp
│       │   ├── example_TextQuery/
│       │   │   ├── Makefile
│       │   │   ├── QueryResult.cpp
│       │   │   ├── QueryResult.h
│       │   │   ├── TextQuery.cpp
│       │   │   ├── TextQuery.h
│       │   │   └── main.cpp
│       │   ├── example_TextQuery2/
│       │   │   ├── Makefile
│       │   │   ├── QueryResult.cpp
│       │   │   ├── QueryResult.h
│       │   │   ├── TextQuery.cpp
│       │   │   ├── TextQuery.h
│       │   │   └── main.cpp
│       │   ├── example_TextQuery_use_StrVec/
│       │   │   ├── Makefile
│       │   │   ├── QueryResult.cpp
│       │   │   ├── QueryResult.h
│       │   │   ├── StrVec.cpp
│       │   │   ├── StrVec.h
│       │   │   ├── TextQuery.cpp
│       │   │   ├── TextQuery.h
│       │   │   └── main.cpp
│       │   ├── example_allocator.cpp
│       │   ├── example_using_own_deletion.cpp
│       │   ├── exercise_12_01.cpp
│       │   ├── exercise_12_02.md
│       │   ├── exercise_12_03.md
│       │   ├── exercise_12_04.md
│       │   ├── exercise_12_05.md
│       │   ├── exercise_12_06.cpp
│       │   ├── exercise_12_07.cpp
│       │   ├── exercise_12_08.md
│       │   ├── exercise_12_09.md
│       │   ├── exercise_12_10.md
│       │   ├── exercise_12_11.md
│       │   ├── exercise_12_12.md
│       │   ├── exercise_12_13.md
│       │   ├── exercise_12_14.md
│       │   ├── exercise_12_15.cpp
│       │   ├── exercise_12_16.cpp
│       │   ├── exercise_12_17.md
│       │   ├── exercise_12_18.md
│       │   ├── exercise_12_19.md
│       │   ├── exercise_12_20.cpp
│       │   ├── exercise_12_21.md
│       │   ├── exercise_12_22.md
│       │   ├── exercise_12_23.cpp
│       │   ├── exercise_12_24.cpp
│       │   ├── exercise_12_25.md
│       │   ├── exercise_12_26.cpp
│       │   ├── exercise_12_27.cpp
│       │   ├── exercise_12_28.cpp
│       │   ├── exercise_12_29.md
│       │   ├── exercise_12_30.md
│       │   ├── exercise_12_31.md
│       │   ├── exercise_12_32.cpp
│       │   └── exercise_12_33.md
│       ├── ch13_Copy_Control/
│       │   ├── build.sh
│       │   ├── example_Copy_Control/
│       │   │   ├── Folder.cpp
│       │   │   ├── Folder.h
│       │   │   ├── Makefile
│       │   │   ├── Message.cpp
│       │   │   ├── Message.h
│       │   │   └── main.cpp
│       │   ├── example_Reference_Count/
│       │   │   ├── HasPtr.cpp
│       │   │   ├── HasPtr.h
│       │   │   ├── Makefile
│       │   │   └── main.cpp
│       │   ├── example_Reference_Qualifier/
│       │   │   ├── Makefile
│       │   │   └── main.cpp
│       │   ├── example_StrVec/
│       │   │   ├── Makefile
│       │   │   ├── StrVec.cpp
│       │   │   ├── StrVec.h
│       │   │   └── main.cpp
│       │   ├── example_String/
│       │   │   ├── Makefile
│       │   │   ├── String.cpp
│       │   │   ├── String.h
│       │   │   └── main.cpp
│       │   ├── exercise_13_01.md
│       │   ├── exercise_13_02.md
│       │   ├── exercise_13_03.md
│       │   ├── exercise_13_04.md
│       │   ├── exercise_13_05.cpp
│       │   ├── exercise_13_06.md
│       │   ├── exercise_13_07.md
│       │   ├── exercise_13_08.cpp
│       │   ├── exercise_13_09.md
│       │   ├── exercise_13_10.md
│       │   ├── exercise_13_11.cpp
│       │   ├── exercise_13_12.md
│       │   ├── exercise_13_13.cpp
│       │   ├── exercise_13_14.md
│       │   ├── exercise_13_15.md
│       │   ├── exercise_13_16.md
│       │   ├── exercise_13_17.cpp
│       │   ├── exercise_13_18.cpp
│       │   ├── exercise_13_19.cpp
│       │   ├── exercise_13_20.md
│       │   ├── exercise_13_21.md
│       │   ├── exercise_13_22.md
│       │   ├── exercise_13_23.md
│       │   ├── exercise_13_24.md
│       │   ├── exercise_13_25.md
│       │   ├── exercise_13_26.cpp
│       │   ├── exercise_13_27.md
│       │   ├── exercise_13_28.cpp
│       │   ├── exercise_13_29.md
│       │   ├── exercise_13_30.cpp
│       │   ├── exercise_13_31.cpp
│       │   ├── exercise_13_32.md
│       │   ├── exercise_13_33.md
│       │   ├── exercise_13_34.md
│       │   ├── exercise_13_35.md
│       │   ├── exercise_13_36.md
│       │   ├── exercise_13_37.md
│       │   ├── exercise_13_38.md
│       │   ├── exercise_13_39.md
│       │   ├── exercise_13_40.md
│       │   ├── exercise_13_41.md
│       │   ├── exercise_13_42.md
│       │   ├── exercise_13_43.md
│       │   ├── exercise_13_44.md
│       │   ├── exercise_13_45.md
│       │   ├── exercise_13_46.md
│       │   ├── exercise_13_47.md
│       │   ├── exercise_13_48.md
│       │   ├── exercise_13_49.md
│       │   ├── exercise_13_50.md
│       │   ├── exercise_13_51.md
│       │   ├── exercise_13_52.md
│       │   ├── exercise_13_53.cpp
│       │   ├── exercise_13_54.md
│       │   ├── exercise_13_55.md
│       │   ├── exercise_13_56.md
│       │   ├── exercise_13_57.md
│       │   └── exercise_13_58.cpp
│       ├── ch14_Overloaded_Operations_and_Conversions/
│       │   ├── build.sh
│       │   ├── example_conversion_operators.cpp
│       │   ├── example_function-call_operator.cpp
│       │   ├── example_function.cpp
│       │   ├── example_std_funcobj.cpp
│       │   ├── exercise_14_01.md
│       │   ├── exercise_14_02.md
│       │   ├── exercise_14_03.md
│       │   ├── exercise_14_04.md
│       │   ├── exercise_14_05.cpp
│       │   ├── exercise_14_06.md
│       │   ├── exercise_14_07.md
│       │   ├── exercise_14_08.md
│       │   ├── exercise_14_09.md
│       │   ├── exercise_14_10.md
│       │   ├── exercise_14_11.md
│       │   ├── exercise_14_12.md
│       │   ├── exercise_14_13.md
│       │   ├── exercise_14_14.md
│       │   ├── exercise_14_15.md
│       │   ├── exercise_14_16.md
│       │   ├── exercise_14_17.md
│       │   ├── exercise_14_18.md
│       │   ├── exercise_14_19.md
│       │   ├── exercise_14_20.md
│       │   ├── exercise_14_21.md
│       │   ├── exercise_14_22.md
│       │   ├── exercise_14_23.md
│       │   ├── exercise_14_24.cpp
│       │   ├── exercise_14_25.md
│       │   ├── exercise_14_26.md
│       │   ├── exercise_14_27.md
│       │   ├── exercise_14_28.md
│       │   ├── exercise_14_29.md
│       │   ├── exercise_14_30.md
│       │   ├── exercise_14_31.md
│       │   ├── exercise_14_32.cpp
│       │   ├── exercise_14_33.md
│       │   ├── exercise_14_34.cpp
│       │   ├── exercise_14_35.cpp
│       │   ├── exercise_14_36.cpp
│       │   ├── exercise_14_37.cpp
│       │   ├── exercise_14_38.cpp
│       │   ├── exercise_14_39.cpp
│       │   ├── exercise_14_40.cpp
│       │   ├── exercise_14_41.md
│       │   ├── exercise_14_42.cpp
│       │   ├── exercise_14_43.cpp
│       │   ├── exercise_14_44.cpp
│       │   ├── exercise_14_45.md
│       │   ├── exercise_14_46.md
│       │   ├── exercise_14_47.md
│       │   ├── exercise_14_48.md
│       │   ├── exercise_14_49.md
│       │   ├── exercise_14_50.cpp
│       │   ├── exercise_14_51.cpp
│       │   ├── exercise_14_52.md
│       │   └── exercise_14_53.cpp
│       ├── ch15_Object-Oriented_Programming/
│       │   ├── build.sh
│       │   ├── example_Access_Control_and_Inheritance/
│       │   │   ├── Makefile
│       │   │   ├── classes.hpp
│       │   │   └── main.cpp
│       │   ├── example_TextQuery/
│       │   │   ├── Makefile
│       │   │   ├── Query.cpp
│       │   │   ├── Query.h
│       │   │   ├── QueryResult.cpp
│       │   │   ├── QueryResult.h
│       │   │   ├── Query_ex15_37.h
│       │   │   ├── Query_ex15_41.cpp.bak
│       │   │   ├── Query_ex15_41.h
│       │   │   ├── TextQuery.cpp
│       │   │   ├── TextQuery.h
│       │   │   └── main.cpp
│       │   ├── example_abstract_base_class.cpp
│       │   ├── example_base_class.cpp
│       │   ├── example_basket.cpp
│       │   ├── example_derived_class.cpp
│       │   ├── example_derived_class_copy_control_members.cpp
│       │   ├── exercise_15_01.md
│       │   ├── exercise_15_02.md
│       │   ├── exercise_15_03.md
│       │   ├── exercise_15_04.md
│       │   ├── exercise_15_05.md
│       │   ├── exercise_15_06.cpp
│       │   ├── exercise_15_07.cpp
│       │   ├── exercise_15_08.md
│       │   ├── exercise_15_09.md
│       │   ├── exercise_15_10.md
│       │   ├── exercise_15_11.md
│       │   ├── exercise_15_12.md
│       │   ├── exercise_15_13.md
│       │   ├── exercise_15_14.md
│       │   ├── exercise_15_15.md
│       │   ├── exercise_15_16.cpp
│       │   ├── exercise_15_17.md
│       │   ├── exercise_15_18.cpp
│       │   ├── exercise_15_19.cpp
│       │   ├── exercise_15_20.md
│       │   ├── exercise_15_21.cpp
│       │   ├── exercise_15_22.md
│       │   ├── exercise_15_23.cpp
│       │   ├── exercise_15_24.md
│       │   ├── exercise_15_25.md
│       │   ├── exercise_15_26.md
│       │   ├── exercise_15_27.cpp
│       │   ├── exercise_15_28.md
│       │   ├── exercise_15_29.md
│       │   ├── exercise_15_30.md
│       │   ├── exercise_15_31.md
│       │   ├── exercise_15_32.md
│       │   ├── exercise_15_33.md
│       │   ├── exercise_15_34.md
│       │   ├── exercise_15_35.md
│       │   ├── exercise_15_36.md
│       │   ├── exercise_15_37.md
│       │   ├── exercise_15_38.md
│       │   ├── exercise_15_39.md
│       │   ├── exercise_15_40.md
│       │   ├── exercise_15_41.md
│       │   └── exercise_15_42.md
│       ├── ch16_Templates_and_GenericProgramming/
│       │   ├── build.sh
│       │   ├── example_Screen/
│       │   │   ├── Makefile
│       │   │   ├── Screen.h
│       │   │   └── main.cpp
│       │   ├── example_SmartPointer/
│       │   │   ├── Makefile
│       │   │   ├── SharedPtr.h
│       │   │   ├── UniquePtr.h
│       │   │   └── main.cpp
│       │   ├── example_Vec/
│       │   │   ├── Makefile
│       │   │   ├── Vec.h
│       │   │   └── main.cpp
│       │   ├── example_customer_MakeShared/
│       │   │   ├── MakeShared.h
│       │   │   ├── Makefile
│       │   │   └── main.cpp
│       │   ├── example_explicit_instantiation/
│       │   │   ├── Application.cpp
│       │   │   ├── Application.h
│       │   │   ├── Makefile
│       │   │   ├── TemplateBuild.cpp
│       │   │   ├── TemplateBuild.h
│       │   │   └── main.cpp
│       │   ├── example_function_template.cpp
│       │   ├── example_member_template/
│       │   │   ├── DebugDelete.h
│       │   │   ├── Makefile
│       │   │   └── main.cpp
│       │   ├── example_overload_and_template.cpp
│       │   ├── example_template_class/
│       │   │   ├── Blob.h
│       │   │   ├── BlobPtr.h
│       │   │   ├── Makefile
│       │   │   └── main.cpp
│       │   ├── example_variadic_template.cpp
│       │   ├── example_variadic_template2.cpp
│       │   ├── exercise_16_01.md
│       │   ├── exercise_16_02.md
│       │   ├── exercise_16_03.cpp
│       │   ├── exercise_16_04.cpp
│       │   ├── exercise_16_05.cpp
│       │   ├── exercise_16_06.cpp
│       │   ├── exercise_16_07.cpp
│       │   ├── exercise_16_08.md
│       │   ├── exercise_16_09.md
│       │   ├── exercise_16_10.md
│       │   ├── exercise_16_11.cpp
│       │   ├── exercise_16_12.md
│       │   ├── exercise_16_13.md
│       │   ├── exercise_16_14.md
│       │   ├── exercise_16_15.md
│       │   ├── exercise_16_16.md
│       │   ├── exercise_16_17.md
│       │   ├── exercise_16_18.cpp
│       │   ├── exercise_16_19.cpp
│       │   ├── exercise_16_20.cpp
│       │   ├── exercise_16_21.md
│       │   ├── exercise_16_22.md
│       │   ├── exercise_16_23.md
│       │   ├── exercise_16_24.md
│       │   ├── exercise_16_25.md
│       │   ├── exercise_16_26.cpp
│       │   ├── exercise_16_27.md
│       │   ├── exercise_16_28.md
│       │   ├── exercise_16_29.cpp
│       │   ├── exercise_16_30.md
│       │   ├── exercise_16_31.md
│       │   ├── exercise_16_32.md
│       │   ├── exercise_16_33.md
│       │   ├── exercise_16_34.md
│       │   ├── exercise_16_35.md
│       │   ├── exercise_16_36.md
│       │   ├── exercise_16_37.cpp
│       │   ├── exercise_16_38.md
│       │   ├── exercise_16_39.md
│       │   ├── exercise_16_40.cpp
│       │   ├── exercise_16_41.cpp
│       │   ├── exercise_16_42.md
│       │   ├── exercise_16_43.md
│       │   ├── exercise_16_44.md
│       │   ├── exercise_16_45.cpp
│       │   ├── exercise_16_46.md
│       │   ├── exercise_16_47.cpp
│       │   ├── exercise_16_48.md
│       │   ├── exercise_16_49.cpp
│       │   ├── exercise_16_50.md
│       │   ├── exercise_16_51.md
│       │   ├── exercise_16_52.md
│       │   ├── exercise_16_53.md
│       │   ├── exercise_16_54.md
│       │   ├── exercise_16_55.cpp
│       │   ├── exercise_16_56.md
│       │   ├── exercise_16_57.md
│       │   ├── exercise_16_58.md
│       │   ├── exercise_16_59.md
│       │   ├── exercise_16_60.md
│       │   ├── exercise_16_61.md
│       │   ├── exercise_16_62.md
│       │   ├── exercise_16_63.cpp
│       │   ├── exercise_16_64.md
│       │   ├── exercise_16_65.cpp
│       │   ├── exercise_16_66.md
│       │   └── exercise_16_67.md
│       ├── ch17_Specialized_Library_Facilities/
│       │   ├── build.sh
│       │   ├── data/
│       │   │   ├── test_rules.txt
│       │   │   └── trans_rules.txt
│       │   ├── example_formatted_io.cpp
│       │   ├── example_phone_number.cpp
│       │   ├── example_random.cpp
│       │   ├── example_regex_error.cpp
│       │   ├── example_regex_replace.cpp
│       │   ├── example_seek_tell.cpp
│       │   ├── example_sregex_iterator.cpp
│       │   ├── example_tuple.cpp
│       │   ├── example_unformatted_io.cpp
│       │   ├── example_using_regex.cpp
│       │   ├── example_using_subexpression.cpp
│       │   ├── exercise_17_01.cpp
│       │   ├── exercise_17_02.cpp
│       │   ├── exercise_17_03.cpp
│       │   ├── exercise_17_04.md
│       │   ├── exercise_17_05.cpp
│       │   ├── exercise_17_06.cpp
│       │   ├── exercise_17_07.md
│       │   ├── exercise_17_08.md
│       │   ├── exercise_17_09.cpp
│       │   ├── exercise_17_10.cpp
│       │   ├── exercise_17_11.cpp
│       │   ├── exercise_17_12.cpp
│       │   ├── exercise_17_13.cpp
│       │   ├── exercise_17_14.cpp
│       │   ├── exercise_17_15.cpp
│       │   ├── exercise_17_16.md
│       │   ├── exercise_17_17.md
│       │   ├── exercise_17_18.cpp
│       │   ├── exercise_17_19.md
│       │   ├── exercise_17_20.md
│       │   ├── exercise_17_21.cpp
│       │   ├── exercise_17_22.cpp
│       │   ├── exercise_17_23.cpp
│       │   ├── exercise_17_24.md
│       │   ├── exercise_17_25.cpp
│       │   ├── exercise_17_26.cpp
│       │   ├── exercise_17_27.cpp
│       │   ├── exercise_17_28.cpp
│       │   ├── exercise_17_29.cpp
│       │   ├── exercise_17_30.cpp
│       │   ├── exercise_17_31.md
│       │   ├── exercise_17_32.md
│       │   ├── exercise_17_33.cpp
│       │   ├── exercise_17_34.md
│       │   ├── exercise_17_35.cpp
│       │   ├── exercise_17_36.cpp
│       │   ├── exercise_17_37.cpp
│       │   ├── exercise_17_38.cpp
│       │   └── exercise_17_39.md
│       ├── ch18_Tools_for_Large_Programs/
│       │   ├── build.sh
│       │   ├── exercise_18_01.cpp
│       │   ├── exercise_18_02.md
│       │   ├── exercise_18_03.cpp
│       │   ├── exercise_18_04.md
│       │   ├── exercise_18_05.cpp
│       │   ├── exercise_18_06.cpp
│       │   ├── exercise_18_07.md
│       │   ├── exercise_18_08.md
│       │   ├── exercise_18_09.md
│       │   ├── exercise_18_10.md
│       │   ├── exercise_18_11.md
│       │   ├── exercise_18_12.md
│       │   ├── exercise_18_13.md
│       │   ├── exercise_18_14.cpp
│       │   ├── exercise_18_15.md
│       │   ├── exercise_18_16.cpp
│       │   ├── exercise_18_17.md
│       │   ├── exercise_18_18.cpp
│       │   ├── exercise_18_19.md
│       │   ├── exercise_18_20.cpp
│       │   ├── exercise_18_21.cpp
│       │   ├── exercise_18_22.cpp
│       │   ├── exercise_18_23.cpp
│       │   ├── exercise_18_24.md
│       │   ├── exercise_18_25.cpp
│       │   ├── exercise_18_26.cpp
│       │   ├── exercise_18_27.cpp
│       │   ├── exercise_18_28.cpp
│       │   ├── exercise_18_29.cpp
│       │   └── exercise_18_30.cpp
│       ├── ch19_Specialized_Tools_and_Techniques/
│       │   ├── build.sh
│       │   ├── example_function_table.cpp
│       │   ├── example_memfunc_as_callable_obj.cpp
│       │   ├── example_placement_new.cpp
│       │   ├── example_pointer_to_member.cpp
│       │   ├── example_type_info.cpp
│       │   ├── example_union_with_class.cpp
│       │   ├── example_use_RTTI.cpp
│       │   ├── exercise_19_01.cpp
│       │   ├── exercise_19_02.md
│       │   ├── exercise_19_03.cpp
│       │   ├── exercise_19_04.cpp
│       │   ├── exercise_19_05.md
│       │   ├── exercise_19_06.cpp
│       │   ├── exercise_19_07.cpp
│       │   ├── exercise_19_08.cpp
│       │   ├── exercise_19_09.md
│       │   ├── exercise_19_10.cpp
│       │   ├── exercise_19_11.md
│       │   ├── exercise_19_12.cpp
│       │   ├── exercise_19_13.cpp
│       │   ├── exercise_19_14.cpp
│       │   ├── exercise_19_15.md
│       │   ├── exercise_19_16.md
│       │   ├── exercise_19_17.md
│       │   ├── exercise_19_18.cpp
│       │   ├── exercise_19_19.cpp
│       │   ├── exercise_19_20.md
│       │   ├── exercise_19_21.md
│       │   ├── exercise_19_22.md
│       │   ├── exercise_19_23.md
│       │   ├── exercise_19_24.md
│       │   ├── exercise_19_25.md
│       │   └── exercise_19_26.cpp
│       ├── data/
│       │   ├── book_sales
│       │   ├── little_story.txt
│       │   ├── numbers.txt
│       │   ├── person_numbers.txt
│       │   └── some_words.txt
│       ├── defined_terms/
│       │   ├── ch01/
│       │   │   ├── argument.md
│       │   │   ├── assignment.md
│       │   │   ├── block.md
│       │   │   ├── buffer.md
│       │   │   ├── built-in_type.md
│       │   │   ├── cerr.md
│       │   │   ├── cin.md
│       │   │   ├── class.md
│       │   │   ├── class_type.md
│       │   │   ├── clog.md
│       │   │   ├── comment.md
│       │   │   ├── condition.md
│       │   │   ├── cout.md
│       │   │   ├── data_structure.md
│       │   │   ├── edit-compile-debug.md
│       │   │   ├── end-of-file.md
│       │   │   ├── expression.md
│       │   │   ├── for_statement.md
│       │   │   ├── function.md
│       │   │   ├── function_body.md
│       │   │   ├── function_name.md
│       │   │   ├── header.md
│       │   │   ├── if_statement.md
│       │   │   ├── initialize.md
│       │   │   ├── iostream.md
│       │   │   ├── istream.md
│       │   │   ├── main.md
│       │   │   ├── manipulator.md
│       │   │   ├── member_function.md
│       │   │   ├── namespace.md
│       │   │   ├── ostream.md
│       │   │   ├── parameter_list.md
│       │   │   ├── return_type.md
│       │   │   ├── source_file.md
│       │   │   ├── standard_error.md
│       │   │   ├── standard_input.md
│       │   │   ├── standard_library.md
│       │   │   ├── standard_output.md
│       │   │   ├── statement.md
│       │   │   ├── string_literal.md
│       │   │   ├── uninitialized_variable.md
│       │   │   ├── variable.md
│       │   │   ├── while_statement.md
│       │   │   ├── 不等运算符.md
│       │   │   ├── 作用域运算符.md
│       │   │   ├── 复合赋值运算符.md
│       │   │   ├── 大于等于运算符.md
│       │   │   ├── 大于运算符.md
│       │   │   ├── 头文件包含指令.md
│       │   │   ├── 小于等于运算符.md
│       │   │   ├── 小于运算符.md
│       │   │   ├── 点运算符.md
│       │   │   ├── 相等运算符.md
│       │   │   ├── 等号运算符.md
│       │   │   ├── 调用运算符.md
│       │   │   ├── 输入运算符.md
│       │   │   ├── 输出运算符.md
│       │   │   ├── 递减运算符.md
│       │   │   └── 递增运算符.md
│       │   ├── ch02/
│       │   │   ├── address.md
│       │   │   ├── alias_declaration.md
│       │   │   ├── arithmetic_type.md
│       │   │   ├── array.md
│       │   │   ├── auto.md
│       │   │   ├── base_type.md
│       │   │   ├── bind.md
│       │   │   ├── byte.md
│       │   │   ├── class_member.md
│       │   │   ├── compound_type.md
│       │   │   ├── const.md
│       │   │   ├── const_expression.md
│       │   │   ├── const_pointer.md
│       │   │   ├── const_reference.md
│       │   │   ├── conversion.md
│       │   │   ├── data_member.md
│       │   │   ├── declaration.md
│       │   │   ├── declarator.md
│       │   │   ├── decltype.md
│       │   │   ├── default_initialization.md
│       │   │   ├── definition.md
│       │   │   ├── escape_sequence.md
│       │   │   ├── global_scope.md
│       │   │   ├── header_guard.md
│       │   │   ├── identifier.md
│       │   │   ├── in-class_initializer.md
│       │   │   ├── list_initialization.md
│       │   │   ├── literal.md
│       │   │   ├── low-level_const.md
│       │   │   ├── nonprintable_character.md
│       │   │   ├── null_pointer.md
│       │   │   ├── nullptr.md
│       │   │   ├── object.md
│       │   │   ├── pointer.md
│       │   │   ├── pointer_to_const.md
│       │   │   ├── preprocessor.md
│       │   │   ├── preprocessor_variable.md
│       │   │   ├── reference.md
│       │   │   ├── reference_to_const.md
│       │   │   ├── scope.md
│       │   │   ├── separate_complilation.md
│       │   │   ├── signed.md
│       │   │   ├── string.md
│       │   │   ├── temporary.md
│       │   │   ├── top-level_const.md
│       │   │   ├── type_alias.md
│       │   │   ├── type_checking.md
│       │   │   ├── type_specifier.md
│       │   │   ├── undefined.md
│       │   │   ├── uninitialized.md
│       │   │   ├── unsigned.md
│       │   │   ├── variable.md
│       │   │   ├── void.md
│       │   │   └── word.md
│       │   ├── ch03/
│       │   │   ├── C-style_string.md
│       │   │   ├── begin.md
│       │   │   ├── buffer_overflow.md
│       │   │   ├── class_template.md
│       │   │   ├── compiler_extension.md
│       │   │   ├── container.md
│       │   │   ├── copy_initialization.md
│       │   │   ├── difference_type.md
│       │   │   ├── direct_initialization.md
│       │   │   ├── empty.md
│       │   │   ├── end.md
│       │   │   ├── getline.md
│       │   │   ├── index.md
│       │   │   ├── instantiation.md
│       │   │   ├── iterator.md
│       │   │   ├── iterator_arithmetic.md
│       │   │   ├── off-the-end_iterator.md
│       │   │   ├── pointer_arithmetic.md
│       │   │   ├── prtdiff_t.md
│       │   │   ├── push_back.md
│       │   │   ├── range_for.md
│       │   │   ├── size.md
│       │   │   ├── size_t.md
│       │   │   ├── size_type.md
│       │   │   ├── string.md
│       │   │   ├── using_declaration.md
│       │   │   ├── value_initialization.md
│       │   │   ├── vector.md
│       │   │   ├── 下标运算符.md
│       │   │   ├── 箭头运算符.md
│       │   │   ├── 输入运算符.md
│       │   │   ├── 输出运算符.md
│       │   │   ├── 递增运算符.md
│       │   │   ├── 逻辑与运算符.md
│       │   │   ├── 逻辑或运算符.md
│       │   │   └── 逻辑非运算符.md
│       │   ├── ch04/
│       │   │   ├── arithmetic_conversion.md
│       │   │   ├── associativity.md
│       │   │   ├── binary_operator.md
│       │   │   ├── cast.md
│       │   │   ├── compound_expression.md
│       │   │   ├── const_cast.md
│       │   │   ├── conversion.md
│       │   │   ├── expression.md
│       │   │   ├── implicit_conversion.md
│       │   │   ├── integral_promotion.md
│       │   │   ├── lvalue.md
│       │   │   ├── operand.md
│       │   │   ├── operator.md
│       │   │   ├── order_of_evaluation.md
│       │   │   ├── overloaded_operator.md
│       │   │   ├── precedence.md
│       │   │   ├── reinterpret_case.md
│       │   │   ├── rvalue.md
│       │   │   ├── short-circuit_evaluation.md
│       │   │   ├── sizeof.md
│       │   │   ├── static_cast.md
│       │   │   ├── unary_operators.md
│       │   │   ├── 位与运算符.md
│       │   │   ├── 位异或运算符.md
│       │   │   ├── 位或运算符.md
│       │   │   ├── 位求反运算符.md
│       │   │   ├── 右移运算符.md
│       │   │   ├── 左移运算符.md
│       │   │   ├── 条件运算符.md
│       │   │   ├── 递减运算符.md
│       │   │   ├── 递增运算符.md
│       │   │   └── 逗号运算符.md
│       │   ├── ch05/
│       │   │   ├── block.md
│       │   │   ├── break_statement.md
│       │   │   ├── case_label.md
│       │   │   ├── catch_clause.md
│       │   │   ├── compound_statement.md
│       │   │   ├── continue_statement.md
│       │   │   ├── dangling_else.md
│       │   │   ├── default_label.md
│       │   │   ├── do_while_statement.md
│       │   │   ├── exception_class.md
│       │   │   ├── exception_declaration.md
│       │   │   ├── exception_handler.md
│       │   │   ├── exception_safe.md
│       │   │   ├── expression_statement.md
│       │   │   ├── flow_of_control.md
│       │   │   ├── for_statement.md
│       │   │   ├── goto_statement.md
│       │   │   ├── if_else_statement.md
│       │   │   ├── if_statement.md
│       │   │   ├── labeled_statement.md
│       │   │   ├── null_statement.md
│       │   │   ├── raise.md
│       │   │   ├── range_for_statment.md
│       │   │   ├── switch_statement.md
│       │   │   ├── terminate.md
│       │   │   ├── throw_expression.md
│       │   │   ├── try_block.md
│       │   │   └── while_statement.md
│       │   ├── ch06/
│       │   │   ├── ambiguous_call.md
│       │   │   ├── argument.md
│       │   │   ├── assert.md
│       │   │   ├── automatic_object.md
│       │   │   ├── best_match.md
│       │   │   ├── candidate_function.md
│       │   │   ├── constexpr.md
│       │   │   ├── default_argument.md
│       │   │   ├── executable_file.md
│       │   │   ├── function_matching.md
│       │   │   ├── function_prototype.md
│       │   │   ├── hidden_name.md
│       │   │   ├── initializer_list.md
│       │   │   ├── inline_function.md
│       │   │   ├── link.md
│       │   │   ├── local_static_object.md
│       │   │   ├── local_variable.md
│       │   │   ├── no_match.md
│       │   │   ├── object_code.md
│       │   │   ├── object_file.md
│       │   │   ├── object_lifetime.md
│       │   │   ├── overloaded_function.md
│       │   │   ├── parameter.md
│       │   │   ├── pass_by_reference.md
│       │   │   ├── pass_by_value.md
│       │   │   ├── preprocessor_macro.md
│       │   │   ├── recursion_loop.md
│       │   │   ├── recursive_function.md
│       │   │   ├── return_type.md
│       │   │   ├── trailing_return_type.md
│       │   │   └── viable_function.md
│       │   ├── ch07/
│       │   │   ├── =default.md
│       │   │   ├── abstract_data_type.md
│       │   │   ├── access_specifier.md
│       │   │   ├── aggregate_class.md
│       │   │   ├── class.md
│       │   │   ├── class_declaration.md
│       │   │   ├── class_scope.md
│       │   │   ├── const_member_function.md
│       │   │   ├── constructor.md
│       │   │   ├── constructor_initializer_list.md
│       │   │   ├── converting_constructor.md
│       │   │   ├── data_abstraction.md
│       │   │   ├── default_constructor.md
│       │   │   ├── delegating_constructor.md
│       │   │   ├── encapsulation.md
│       │   │   ├── explicit_constructor.md
│       │   │   ├── forward_declaration.md
│       │   │   ├── friend.md
│       │   │   ├── implementation.md
│       │   │   ├── incomplete_type.md
│       │   │   ├── interface.md
│       │   │   ├── member_function.md
│       │   │   ├── mutable_data_member.md
│       │   │   ├── name_lookup.md
│       │   │   ├── private_member.md
│       │   │   ├── public_member.md
│       │   │   ├── synthesized_default_constructor.md
│       │   │   └── this_pointer.md
│       │   ├── ch08/
│       │   │   ├── condition_state.md
│       │   │   ├── file_mode.md
│       │   │   ├── file_stream.md
│       │   │   ├── fstream.md
│       │   │   ├── ifstream.md
│       │   │   ├── inheritance.md
│       │   │   ├── istringstream.md
│       │   │   ├── ofstream.md
│       │   │   └── string_stream.md
│       │   ├── ch09/
│       │   │   ├── adaptor.md
│       │   │   ├── array.md
│       │   │   ├── begin.md
│       │   │   ├── cbegin.md
│       │   │   ├── cend.md
│       │   │   ├── container.md
│       │   │   ├── deque.md
│       │   │   ├── end.md
│       │   │   ├── forward_list.md
│       │   │   ├── iterator_range.md
│       │   │   ├── left-inclusive_interval.md
│       │   │   ├── list.md
│       │   │   ├── off-the-beginning_iterator.md
│       │   │   ├── off-the-end_iterator.md
│       │   │   ├── priority_queue.md
│       │   │   ├── queue.md
│       │   │   ├── sequential_container.md
│       │   │   ├── stack.md
│       │   │   └── vector.md
│       │   ├── ch10/
│       │   │   ├── back_inserter.md
│       │   │   ├── bidirectional_iterator.md
│       │   │   ├── binary_predicate.md
│       │   │   ├── bind.md
│       │   │   ├── callable_object.md
│       │   │   ├── capture_list.md
│       │   │   ├── cref.md
│       │   │   ├── forward_iterator.md
│       │   │   ├── front_insertor.md
│       │   │   ├── generic_algorithm.md
│       │   │   ├── input_iterator.md
│       │   │   ├── insert_iterator.md
│       │   │   ├── inserter.md
│       │   │   ├── istream_iterator.md
│       │   │   ├── iterator_category.md
│       │   │   ├── lambda_expression.md
│       │   │   ├── move_iterator.md
│       │   │   ├── ostream_iterator.md
│       │   │   ├── output_iterator.md
│       │   │   ├── predicate.md
│       │   │   ├── random-access_iterator.md
│       │   │   ├── ref.md
│       │   │   ├── reverse_iterator.md
│       │   │   ├── stream_iterator.md
│       │   │   └── unary_predicate.md
│       │   ├── ch11/
│       │   │   ├── associative_array.md
│       │   │   ├── associative_container.md
│       │   │   ├── hash.md
│       │   │   ├── hash_function.md
│       │   │   ├── key_type.md
│       │   │   ├── map.md
│       │   │   ├── mapped_type.md
│       │   │   ├── multimap.md
│       │   │   ├── multiset.md
│       │   │   ├── pair.md
│       │   │   ├── set.md
│       │   │   ├── strict_weak_ordering.md
│       │   │   ├── unordered_container.md
│       │   │   ├── unordered_map.md
│       │   │   ├── unordered_multimap.md
│       │   │   ├── unordered_multiset.md
│       │   │   ├── unordered_set.md
│       │   │   └── value_type.md
│       │   ├── ch12/
│       │   │   ├── allocator.md
│       │   │   ├── dangling_pointer.md
│       │   │   ├── delete.md
│       │   │   ├── deleter.md
│       │   │   ├── destructor.md
│       │   │   ├── dynamically_allocated.md
│       │   │   ├── free_store.md
│       │   │   ├── heap.md
│       │   │   ├── new.md
│       │   │   ├── placement_new.md
│       │   │   ├── reference_count.md
│       │   │   ├── shared_ptr.md
│       │   │   ├── smart_pointer.md
│       │   │   ├── unique_ptr.md
│       │   │   └── weak_ptr.md
│       │   ├── ch13/
│       │   │   ├── copy-assignment_operator.md
│       │   │   ├── copy_and_swap.md
│       │   │   ├── copy_constructor.md
│       │   │   ├── copy_control.md
│       │   │   ├── copy_initialization.md
│       │   │   ├── deleted_function.md
│       │   │   ├── destructor.md
│       │   │   ├── lvalue_reference.md
│       │   │   ├── memberwise_copy_assign.md
│       │   │   ├── move-assignment_operator.md
│       │   │   ├── move.md
│       │   │   ├── move_constructor.md
│       │   │   ├── overload_operator.md
│       │   │   ├── reference_count.md
│       │   │   ├── reference_qualifier.md
│       │   │   ├── rvalue_reference.md
│       │   │   ├── synthesized_assignment_operator.md
│       │   │   ├── synthesized_copy_move_constructor.md
│       │   │   └── synthesized_destructor.md
│       │   ├── ch14/
│       │   │   ├── call_signature.md
│       │   │   ├── class-type_conversion.md
│       │   │   ├── conversion_operator.md
│       │   │   ├── explicit_conversion_operator.md
│       │   │   ├── function_object.md
│       │   │   ├── function_table.md
│       │   │   ├── function_template.md
│       │   │   ├── overloaded_operator.md
│       │   │   └── user-defined_conversion.md
│       │   ├── ch15/
│       │   │   ├── abstract_base_class.md
│       │   │   ├── accessible.md
│       │   │   ├── base_class.md
│       │   │   ├── class_derivation_list.md
│       │   │   ├── derived-to-base_conversion.md
│       │   │   ├── derived_class.md
│       │   │   ├── direct_base_class.md
│       │   │   ├── dynamic_binding.md
│       │   │   ├── dynamic_type.md
│       │   │   ├── indirect_base_class.md
│       │   │   ├── inheritance.md
│       │   │   ├── object-oriented_programming.md
│       │   │   ├── override.md
│       │   │   ├── polymorphism.md
│       │   │   ├── private_inheritance.md
│       │   │   ├── protected_access_specifier.md
│       │   │   ├── protected_inheritance.md
│       │   │   ├── public_inheritance.md
│       │   │   ├── pure_virtual.md
│       │   │   ├── refactoring.md
│       │   │   ├── run-time_binding.md
│       │   │   ├── sliced_down.md
│       │   │   ├── static_type.md
│       │   │   └── virtual_function.md
│       │   ├── ch16/
│       │   │   ├── class_template.md
│       │   │   ├── default_template_argument.md
│       │   │   ├── explicit_instantiation.md
│       │   │   ├── explicit_template_argument.md
│       │   │   ├── function_parameter_pack.md
│       │   │   ├── function_template.md
│       │   │   ├── instantiate.md
│       │   │   ├── instantiation.md
│       │   │   ├── member_template.md
│       │   │   ├── nontype_parameter.md
│       │   │   ├── pack_expansion.md
│       │   │   ├── parameter_pack.md
│       │   │   ├── partial_specialization.md
│       │   │   ├── pattern.md
│       │   │   ├── template_argument.md
│       │   │   ├── template_argument_deduction.md
│       │   │   ├── template_parameter.md
│       │   │   ├── template_parameter_list.md
│       │   │   ├── template_parameter_pack.md
│       │   │   ├── template_specialization.md
│       │   │   ├── type_parameter.md
│       │   │   ├── type_transformation.md
│       │   │   └── variadic_template.md
│       │   ├── ch17/
│       │   │   ├── bitset.md
│       │   │   ├── cmatch.md
│       │   │   ├── cregex_iterator.md
│       │   │   ├── csub_match.md
│       │   │   ├── default_random_engine.md
│       │   │   ├── formatted_IO.md
│       │   │   ├── get.md
│       │   │   ├── high-order.md
│       │   │   ├── low-order.md
│       │   │   ├── manipulator.md
│       │   │   ├── random-number_distribution.md
│       │   │   ├── random-number_engine.md
│       │   │   ├── random-number_generator.md
│       │   │   ├── regex.md
│       │   │   ├── regex_error.md
│       │   │   ├── regex_match.md
│       │   │   ├── regex_replace.md
│       │   │   ├── regex_search.md
│       │   │   ├── regular_expression.md
│       │   │   ├── seed.md
│       │   │   ├── smatch.md
│       │   │   ├── sregex_iterator.md
│       │   │   ├── ssub_match.md
│       │   │   ├── subexpression.md
│       │   │   ├── tuple.md
│       │   │   └── unformatted_IO.md
│       │   ├── ch18/
│       │   │   ├── catch-all.md
│       │   │   ├── catch_clause.md
│       │   │   ├── constructor_order.md
│       │   │   ├── exception_declaration.md
│       │   │   ├── exception_handling.md
│       │   │   ├── exception_object.md
│       │   │   ├── file_static.md
│       │   │   ├── function_try_block.md
│       │   │   ├── global_namespace.md
│       │   │   ├── handler.md
│       │   │   ├── inline_namespace.md
│       │   │   ├── multiple_inheritance.md
│       │   │   ├── namespace.md
│       │   │   ├── namespace_alias.md
│       │   │   ├── namespace_pollution.md
│       │   │   ├── noexcept_operator.md
│       │   │   ├── noexcept_specification.md
│       │   │   ├── nonthrowing_specification.md
│       │   │   ├── raise.md
│       │   │   ├── rethrow.md
│       │   │   ├── stack_unwinding.md
│       │   │   ├── terminate.md
│       │   │   ├── throw.md
│       │   │   ├── try_block.md
│       │   │   ├── unnamed_namespace.md
│       │   │   ├── using_declaration.md
│       │   │   ├── using_directive.md
│       │   │   ├── virtual_base_class.md
│       │   │   └── virtual_inheritance.md
│       │   ├── ch19/
│       │   │   ├── anonymous_union.md
│       │   │   ├── bit-field.md
│       │   │   ├── discriminant.md
│       │   │   ├── dynamic_cast.md
│       │   │   ├── enumeration.md
│       │   │   ├── enumerator.md
│       │   │   ├── free.md
│       │   │   ├── link_directive.md
│       │   │   ├── local_class.md
│       │   │   ├── malloc.md
│       │   │   ├── mem_fn.md
│       │   │   ├── nested_class.md
│       │   │   ├── nested_type.md
│       │   │   ├── nonportable.md
│       │   │   ├── operator_delete.md
│       │   │   ├── operator_new.md
│       │   │   ├── placement_new_expression.md
│       │   │   ├── pointer_to_member.md
│       │   │   ├── run-time_tyoe_identification.md
│       │   │   ├── scoped_enumeration.md
│       │   │   ├── typeid_operator.md
│       │   │   ├── typeinfo.md
│       │   │   ├── union.md
│       │   │   ├── unscoped_enumeration.md
│       │   │   └── volatile.md
│       │   ├── gen_index.sh
│       │   └── terms_index.md
│       └── gen_readme.sh
├── mkdocs.yml
└── notes/
    ├── CProgramming/
    │   ├── ch01 C语言概述.md
    │   ├── ch02 C语言基本概念.md
    │   ├── ch03 格式化输入输出.md
    │   ├── ch04 表达式.md
    │   ├── ch05 选择语句.md
    │   ├── ch06 循环.md
    │   ├── ch07 基本类型.md
    │   ├── ch08 数组.md
    │   ├── ch09 函数.md
    │   ├── ch10 程序结构.md
    │   ├── ch11 指针.md
    │   ├── ch12 指针和数组.md
    │   ├── ch13 字符串.md
    │   ├── ch14 预处理器.md
    │   ├── ch15 编写大规模程序.md
    │   ├── ch16 结构、联合和枚举.md
    │   ├── ch17 指针的高级应用.md
    │   ├── ch18 声明.md
    │   ├── ch19 程序设计.md
    │   ├── ch20 低级程序设计.md
    │   ├── ch21 标准库.md
    │   ├── ch22 输入_输出.md
    │   ├── ch23 库对数值和字符数据的支持.md
    │   ├── ch24 错误处理.md
    │   ├── ch25 国际化特性.md
    │   ├── ch26 其他库函数.md
    │   └── cheatsheet/
    │       └── 惯用法.md
    ├── CppPrimer/
    │   ├── ch01 开始.md
    │   ├── ch02 变量和基本类型.md
    │   ├── ch03 字符串、向量和数组.md
    │   ├── ch04 表达式.md
    │   ├── ch05 语句.md
    │   ├── ch06 函数.md
    │   ├── ch07 类.md
    │   ├── ch08 IO库.md
    │   ├── ch09 顺序容器.md
    │   ├── ch10 泛型算法.md
    │   ├── ch11 关联容器.md
    │   ├── ch12 动态内存.md
    │   ├── ch13 拷贝控制.md
    │   ├── ch14 操作重载与类型转换.md
    │   ├── ch15 面向对象程序设计.md
    │   ├── ch16 模板与泛型编程.md
    │   ├── ch17 标准库特殊设施.md
    │   ├── ch18 用于大型程序的工具.md
    │   └── ch19 特殊工具与技术.md
    ├── EffectiveModernCpp/
    │   ├── ch01_型别推导/
    │   │   ├── 条款1_理解模板型别推导.md
    │   │   ├── 条款2_理解auto型别推导.md
    │   │   ├── 条款3_理解decltype.md
    │   │   └── 条款4_掌握查看型别推导结果的方法.md
    │   └── ch02_auto/
    │       ├── 条款5_优先选用auto而非显式型别声明.md
    │       └── 条款6_当auto推导的型别不符合要求时使用带显式型别的初始化物习惯用法.md
    └── index.md

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
site/
nohup.out
.vscode/

================================================
FILE: auto_refresh_mkdocs_site.sh
================================================
#! /bin/bash

while true; do
	sleep 3

	if git pull origin master | grep '^Updating' ; then

		echo "[$(date)] mkdocs gh-deploy"
		mkdocs gh-deploy

	fi
done


================================================
FILE: codes/CProgramming/README.md
================================================
# C语言程序设计:现代方法

学习环境:CentOS 7, VS Code & MinGW & Git-Bash

第25章 测试多字符与宽字符采取的环境是 CentOS7 ,在 Windows 下测试会出现问题

---

## 练习题

### 第2章 C语言基本概念

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch02_C语言基本概念/ex_01.c "./ch02_C语言基本概念/ex_01.c")|[练习2](./ch02_C语言基本概念/ex_02.c "./ch02_C语言基本概念/ex_02.c")|[练习3](./ch02_C语言基本概念/ex_03.c "./ch02_C语言基本概念/ex_03.c")|[练习4](./ch02_C语言基本概念/ex_04.c "./ch02_C语言基本概念/ex_04.c")|[练习5](./ch02_C语言基本概念/ex_05.c "./ch02_C语言基本概念/ex_05.c")|[练习6](./ch02_C语言基本概念/ex_06.c "./ch02_C语言基本概念/ex_06.c")|
|[练习7](./ch02_C语言基本概念/ex_07.c "./ch02_C语言基本概念/ex_07.c")|[练习8](./ch02_C语言基本概念/ex_08.c "./ch02_C语言基本概念/ex_08.c")|[练习9](./ch02_C语言基本概念/ex_09.md "./ch02_C语言基本概念/ex_09.md")|[练习10](./ch02_C语言基本概念/ex_10.c "./ch02_C语言基本概念/ex_10.c")|[练习11](./ch02_C语言基本概念/ex_11.md "./ch02_C语言基本概念/ex_11.md")|[练习12](./ch02_C语言基本概念/ex_12.md "./ch02_C语言基本概念/ex_12.md")|
|[练习13](./ch02_C语言基本概念/ex_13.md "./ch02_C语言基本概念/ex_13.md")|

### 第3章 格式化的输入输出

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch03_格式化的输入输出/ex_01.c "./ch03_格式化的输入输出/ex_01.c")|[练习2](./ch03_格式化的输入输出/ex_02.c "./ch03_格式化的输入输出/ex_02.c")|[练习3](./ch03_格式化的输入输出/ex_03.c "./ch03_格式化的输入输出/ex_03.c")|[练习4](./ch03_格式化的输入输出/ex_04.c "./ch03_格式化的输入输出/ex_04.c")|[练习5](./ch03_格式化的输入输出/ex_05.c "./ch03_格式化的输入输出/ex_05.c")|[练习6](./ch03_格式化的输入输出/ex_06.c "./ch03_格式化的输入输出/ex_06.c")|
|[练习7](./ch03_格式化的输入输出/ex_07.c "./ch03_格式化的输入输出/ex_07.c")|[练习8](./ch03_格式化的输入输出/ex_08.c "./ch03_格式化的输入输出/ex_08.c")|

### 第4章 表达式

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch04_表达式/ex_01.c "./ch04_表达式/ex_01.c")|[练习2](./ch04_表达式/ex_02.c "./ch04_表达式/ex_02.c")|[练习3](./ch04_表达式/ex_03.c "./ch04_表达式/ex_03.c")|[练习4](./ch04_表达式/ex_04.c "./ch04_表达式/ex_04.c")|[练习5](./ch04_表达式/ex_05.c "./ch04_表达式/ex_05.c")|[练习6](./ch04_表达式/ex_06.c "./ch04_表达式/ex_06.c")|
|[练习7](./ch04_表达式/ex_07.c "./ch04_表达式/ex_07.c")|[练习8](./ch04_表达式/ex_08.c "./ch04_表达式/ex_08.c")|[练习9](./ch04_表达式/ex_09.md "./ch04_表达式/ex_09.md")|[练习10](./ch04_表达式/ex_10.c "./ch04_表达式/ex_10.c")|[练习11](./ch04_表达式/ex_11.md "./ch04_表达式/ex_11.md")|

### 第5章 选择语句

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch05_选择语句/ex_01.c "./ch05_选择语句/ex_01.c")|[练习2](./ch05_选择语句/ex_02.c "./ch05_选择语句/ex_02.c")|[练习3](./ch05_选择语句/ex_03.c "./ch05_选择语句/ex_03.c")|[练习4](./ch05_选择语句/ex_04.c "./ch05_选择语句/ex_04.c")|[练习5](./ch05_选择语句/ex_05.c "./ch05_选择语句/ex_05.c")|[练习6](./ch05_选择语句/ex_06.c "./ch05_选择语句/ex_06.c")|
|[练习7](./ch05_选择语句/ex_07.c "./ch05_选择语句/ex_07.c")|[练习8](./ch05_选择语句/ex_08.c "./ch05_选择语句/ex_08.c")|[练习9](./ch05_选择语句/ex_09.c "./ch05_选择语句/ex_09.c")|[练习10](./ch05_选择语句/ex_10.c "./ch05_选择语句/ex_10.c")|[练习11](./ch05_选择语句/ex_11.c "./ch05_选择语句/ex_11.c")|[练习12](./ch05_选择语句/ex_12.c "./ch05_选择语句/ex_12.c")|
|[练习13](./ch05_选择语句/ex_13.c "./ch05_选择语句/ex_13.c")|[练习14](./ch05_选择语句/ex_14.c "./ch05_选择语句/ex_14.c")|[练习15](./ch05_选择语句/ex_15.c "./ch05_选择语句/ex_15.c")|[练习16](./ch05_选择语句/ex_16.c "./ch05_选择语句/ex_16.c")|

### 第6章 循环

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch06_循环/ex_01.c "./ch06_循环/ex_01.c")|[练习2](./ch06_循环/ex_02.c "./ch06_循环/ex_02.c")|[练习3](./ch06_循环/ex_03.c "./ch06_循环/ex_03.c")|[练习4](./ch06_循环/ex_04.c "./ch06_循环/ex_04.c")|[练习5](./ch06_循环/ex_05.c "./ch06_循环/ex_05.c")|[练习6](./ch06_循环/ex_06.c "./ch06_循环/ex_06.c")|
|[练习7](./ch06_循环/ex_07.c "./ch06_循环/ex_07.c")|[练习8](./ch06_循环/ex_08.c "./ch06_循环/ex_08.c")|[练习9](./ch06_循环/ex_09.c "./ch06_循环/ex_09.c")|[练习10](./ch06_循环/ex_10.md "./ch06_循环/ex_10.md")|[练习11](./ch06_循环/ex_11.md "./ch06_循环/ex_11.md")|[练习12](./ch06_循环/ex_12.c "./ch06_循环/ex_12.c")|
|[练习13](./ch06_循环/ex_13.c "./ch06_循环/ex_13.c")|[练习14](./ch06_循环/ex_14.c "./ch06_循环/ex_14.c")|[练习15](./ch06_循环/ex_15.c "./ch06_循环/ex_15.c")|[练习16](./ch06_循环/ex_16.md "./ch06_循环/ex_16.md")|

### 第7章 基本类型

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch07_基本类型/ex_01.c "./ch07_基本类型/ex_01.c")|[练习2](./ch07_基本类型/ex_02.c "./ch07_基本类型/ex_02.c")|[练习3](./ch07_基本类型/ex_03.c "./ch07_基本类型/ex_03.c")|[练习4](./ch07_基本类型/ex_04.c "./ch07_基本类型/ex_04.c")|[练习5](./ch07_基本类型/ex_05.c "./ch07_基本类型/ex_05.c")|[练习6](./ch07_基本类型/ex_06.c "./ch07_基本类型/ex_06.c")|
|[练习7](./ch07_基本类型/ex_07.md "./ch07_基本类型/ex_07.md")|[练习8](./ch07_基本类型/ex_08.c "./ch07_基本类型/ex_08.c")|[练习9](./ch07_基本类型/ex_09.c "./ch07_基本类型/ex_09.c")|[练习10](./ch07_基本类型/ex_10.c "./ch07_基本类型/ex_10.c")|[练习11](./ch07_基本类型/ex_11.c "./ch07_基本类型/ex_11.c")|[练习12](./ch07_基本类型/ex_12.c "./ch07_基本类型/ex_12.c")|
|[练习13](./ch07_基本类型/ex_13.md "./ch07_基本类型/ex_13.md")|[练习14](./ch07_基本类型/ex_15.md "./ch07_基本类型/ex_15.md")|[练习15](./ch07_基本类型/ex_16.md "./ch07_基本类型/ex_16.md")|[练习16](./ch07_基本类型/ex_17.c "./ch07_基本类型/ex_17.c")|[练习17](./ch07_基本类型/ex_18.md "./ch07_基本类型/ex_18.md")|[练习18](./ch07_基本类型/ex_19.c "./ch07_基本类型/ex_19.c")|

### 第8章 数组

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch08_数组/ex_01.c "./ch08_数组/ex_01.c")|[练习2](./ch08_数组/ex_02.c "./ch08_数组/ex_02.c")|[练习3](./ch08_数组/ex_03.c "./ch08_数组/ex_03.c")|[练习4](./ch08_数组/ex_04.md "./ch08_数组/ex_04.md")|[练习5](./ch08_数组/ex_05.c "./ch08_数组/ex_05.c")|[练习6](./ch08_数组/ex_06.c "./ch08_数组/ex_06.c")|
|[练习7](./ch08_数组/ex_07.c "./ch08_数组/ex_07.c")|[练习8](./ch08_数组/ex_08.md "./ch08_数组/ex_08.md")|[练习9](./ch08_数组/ex_09.c "./ch08_数组/ex_09.c")|[练习10](./ch08_数组/ex_10.c "./ch08_数组/ex_10.c")|[练习11](./ch08_数组/ex_11.c "./ch08_数组/ex_11.c")|[练习12](./ch08_数组/ex_12.c "./ch08_数组/ex_12.c")|
|[练习13](./ch08_数组/ex_13.c "./ch08_数组/ex_13.c")|

### 第9章 函数

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch09_函数/ex_01.c "./ch09_函数/ex_01.c")|[练习2](./ch09_函数/ex_02.c "./ch09_函数/ex_02.c")|[练习3](./ch09_函数/ex_03.c "./ch09_函数/ex_03.c")|[练习4](./ch09_函数/ex_04.c "./ch09_函数/ex_04.c")|[练习5](./ch09_函数/ex_05.c "./ch09_函数/ex_05.c")|[练习6](./ch09_函数/ex_06.c "./ch09_函数/ex_06.c")|
|[练习7](./ch09_函数/ex_07.c "./ch09_函数/ex_07.c")|[练习8](./ch09_函数/ex_08.md "./ch09_函数/ex_08.md")|[练习9](./ch09_函数/ex_09.c "./ch09_函数/ex_09.c")|[练习10](./ch09_函数/ex_10.c "./ch09_函数/ex_10.c")|[练习11](./ch09_函数/ex_11.md "./ch09_函数/ex_11.md")|[练习12](./ch09_函数/ex_12.c "./ch09_函数/ex_12.c")|
|[练习13](./ch09_函数/ex_13.c "./ch09_函数/ex_13.c")|[练习14](./ch09_函数/ex_14.c "./ch09_函数/ex_14.c")|[练习15](./ch09_函数/ex_15.c "./ch09_函数/ex_15.c")|[练习16](./ch09_函数/ex_16.c "./ch09_函数/ex_16.c")|[练习17](./ch09_函数/ex_17.c "./ch09_函数/ex_17.c")|

### 第10章 程序结构

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch10_程序结构/ex_01.c "./ch10_程序结构/ex_01.c")|[练习2](./ch10_程序结构/ex_02.md "./ch10_程序结构/ex_02.md")|[练习3](./ch10_程序结构/ex_03.c "./ch10_程序结构/ex_03.c")|[练习4](./ch10_程序结构/ex_04.c "./ch10_程序结构/ex_04.c")|[练习5](./ch10_程序结构/ex_05.c "./ch10_程序结构/ex_05.c")|[练习6](./ch10_程序结构/ex_06.c "./ch10_程序结构/ex_06.c")|
|[练习7](./ch10_程序结构/ex_07.c "./ch10_程序结构/ex_07.c")|

### 第11章 指针

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch11_指针/ex_01.md "./ch11_指针/ex_01.md")|[练习2](./ch11_指针/ex_02.md "./ch11_指针/ex_02.md")|[练习3](./ch11_指针/ex_03.c "./ch11_指针/ex_03.c")|[练习4](./ch11_指针/ex_04.c "./ch11_指针/ex_04.c")|[练习5](./ch11_指针/ex_05.c "./ch11_指针/ex_05.c")|[练习6](./ch11_指针/ex_06.c "./ch11_指针/ex_06.c")|

### 第12章 指针和数组

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch12_指针和数组/ex_01.c "./ch12_指针和数组/ex_01.c")|[练习2](./ch12_指针和数组/ex_02.md "./ch12_指针和数组/ex_02.md")|[练习3](./ch12_指针和数组/ex_03.c "./ch12_指针和数组/ex_03.c")|[练习4](./ch12_指针和数组/ex_04.c "./ch12_指针和数组/ex_04.c")|[练习5](./ch12_指针和数组/ex_05.c "./ch12_指针和数组/ex_05.c")|[练习6](./ch12_指针和数组/ex_06.c "./ch12_指针和数组/ex_06.c")|
|[练习7](./ch12_指针和数组/ex_07.md "./ch12_指针和数组/ex_07.md")|[练习8](./ch12_指针和数组/ex_08.md "./ch12_指针和数组/ex_08.md")|[练习9](./ch12_指针和数组/ex_09.md "./ch12_指针和数组/ex_09.md")|[练习10](./ch12_指针和数组/ex_10.c "./ch12_指针和数组/ex_10.c")|[练习11](./ch12_指针和数组/ex_11.c "./ch12_指针和数组/ex_11.c")|[练习12](./ch12_指针和数组/ex_12.c "./ch12_指针和数组/ex_12.c")|
|[练习13](./ch12_指针和数组/ex_13.c "./ch12_指针和数组/ex_13.c")|[练习14](./ch12_指针和数组/ex_14.c "./ch12_指针和数组/ex_14.c")|[练习15](./ch12_指针和数组/ex_15.c "./ch12_指针和数组/ex_15.c")|

### 第13章 字符串

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch13_字符串/ex_01.md "./ch13_字符串/ex_01.md")|[练习2](./ch13_字符串/ex_02.md "./ch13_字符串/ex_02.md")|[练习3](./ch13_字符串/ex_03.c "./ch13_字符串/ex_03.c")|[练习4](./ch13_字符串/ex_04.c "./ch13_字符串/ex_04.c")|[练习5](./ch13_字符串/ex_05.c "./ch13_字符串/ex_05.c")|[练习6](./ch13_字符串/ex_06.c "./ch13_字符串/ex_06.c")|
|[练习7](./ch13_字符串/ex_07.c "./ch13_字符串/ex_07.c")|[练习8](./ch13_字符串/ex_08.c "./ch13_字符串/ex_08.c")|[练习9](./ch13_字符串/ex_09.md "./ch13_字符串/ex_09.md")|[练习10](./ch13_字符串/ex_10.c "./ch13_字符串/ex_10.c")|[练习11](./ch13_字符串/ex_11.c "./ch13_字符串/ex_11.c")|[练习12](./ch13_字符串/ex_12.md "./ch13_字符串/ex_12.md")|
|[练习13](./ch13_字符串/ex_13.c "./ch13_字符串/ex_13.c")|[练习14](./ch13_字符串/ex_14.c "./ch13_字符串/ex_14.c")|[练习15](./ch13_字符串/ex_15.c "./ch13_字符串/ex_15.c")|[练习16](./ch13_字符串/ex_16.c "./ch13_字符串/ex_16.c")|[练习17](./ch13_字符串/ex_17.c "./ch13_字符串/ex_17.c")|[练习18](./ch13_字符串/ex_18.md "./ch13_字符串/ex_18.md")|
|[练习19](./ch13_字符串/ex_19.c "./ch13_字符串/ex_19.c")|[练习20](./ch13_字符串/ex_20.c "./ch13_字符串/ex_20.c")|

### 第14章 预处理器

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch14_预处理器/ex_01.c "./ch14_预处理器/ex_01.c")|[练习2](./ch14_预处理器/ex_02.c "./ch14_预处理器/ex_02.c")|[练习3](./ch14_预处理器/ex_03.c "./ch14_预处理器/ex_03.c")|[练习4](./ch14_预处理器/ex_04.c "./ch14_预处理器/ex_04.c")|[练习5](./ch14_预处理器/ex_05.c "./ch14_预处理器/ex_05.c")|[练习6](./ch14_预处理器/ex_06.c "./ch14_预处理器/ex_06.c")|
|[练习7](./ch14_预处理器/ex_07.c "./ch14_预处理器/ex_07.c")|[练习8](./ch14_预处理器/ex_08.c "./ch14_预处理器/ex_08.c")|[练习9](./ch14_预处理器/ex_09.c "./ch14_预处理器/ex_09.c")|[练习10](./ch14_预处理器/ex_10.c "./ch14_预处理器/ex_10.c")|[练习11](./ch14_预处理器/ex_11.c "./ch14_预处理器/ex_11.c")|[练习12](./ch14_预处理器/ex_12.c "./ch14_预处理器/ex_12.c")|

### 第15章 编写大规模程序

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch15_编写大规模程序/ex_01.md "./ch15_编写大规模程序/ex_01.md")|[练习2](./ch15_编写大规模程序/ex_02.md "./ch15_编写大规模程序/ex_02.md")|[练习3](./ch15_编写大规模程序/ex_03.md "./ch15_编写大规模程序/ex_03.md")|[练习4](./ch15_编写大规模程序/ex_04.md "./ch15_编写大规模程序/ex_04.md")|[练习5](./ch15_编写大规模程序/ex_05.md "./ch15_编写大规模程序/ex_05.md")|[练习6](./ch15_编写大规模程序/ex_06.md "./ch15_编写大规模程序/ex_06.md")|
|[练习7](./ch15_编写大规模程序/ex_07.md "./ch15_编写大规模程序/ex_07.md")|[练习8](./ch15_编写大规模程序/ex_08.md "./ch15_编写大规模程序/ex_08.md")|[练习9](./ch15_编写大规模程序/ex_09.md "./ch15_编写大规模程序/ex_09.md")|

### 第16章 结构_联合_枚举

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch16_结构_联合_枚举/ex_01.c "./ch16_结构_联合_枚举/ex_01.c")|[练习2](./ch16_结构_联合_枚举/ex_02.c "./ch16_结构_联合_枚举/ex_02.c")|[练习3](./ch16_结构_联合_枚举/ex_04.md "./ch16_结构_联合_枚举/ex_04.md")|[练习4](./ch16_结构_联合_枚举/ex_05.c "./ch16_结构_联合_枚举/ex_05.c")|[练习5](./ch16_结构_联合_枚举/ex_06.c "./ch16_结构_联合_枚举/ex_06.c")|[练习6](./ch16_结构_联合_枚举/ex_07.md "./ch16_结构_联合_枚举/ex_07.md")|
|[练习7](./ch16_结构_联合_枚举/ex_08.md "./ch16_结构_联合_枚举/ex_08.md")|[练习8](./ch16_结构_联合_枚举/ex_09.md "./ch16_结构_联合_枚举/ex_09.md")|[练习9](./ch16_结构_联合_枚举/ex_10.c "./ch16_结构_联合_枚举/ex_10.c")|[练习10](./ch16_结构_联合_枚举/ex_11.c "./ch16_结构_联合_枚举/ex_11.c")|[练习11](./ch16_结构_联合_枚举/ex_12.c "./ch16_结构_联合_枚举/ex_12.c")|[练习12](./ch16_结构_联合_枚举/ex_13.md "./ch16_结构_联合_枚举/ex_13.md")|
|[练习13](./ch16_结构_联合_枚举/ex_14.c "./ch16_结构_联合_枚举/ex_14.c")|[练习14](./ch16_结构_联合_枚举/ex_15.md "./ch16_结构_联合_枚举/ex_15.md")|[练习15](./ch16_结构_联合_枚举/ex_16.md "./ch16_结构_联合_枚举/ex_16.md")|[练习16](./ch16_结构_联合_枚举/ex_17.c "./ch16_结构_联合_枚举/ex_17.c")|

### 第17章 指针的高级应用

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch17_指针的高级应用/ex_01.c "./ch17_指针的高级应用/ex_01.c")|[练习2](./ch17_指针的高级应用/ex_02.c "./ch17_指针的高级应用/ex_02.c")|[练习3](./ch17_指针的高级应用/ex_03.c "./ch17_指针的高级应用/ex_03.c")|[练习4](./ch17_指针的高级应用/ex_04.md "./ch17_指针的高级应用/ex_04.md")|[练习5](./ch17_指针的高级应用/ex_05.c "./ch17_指针的高级应用/ex_05.c")|[练习6](./ch17_指针的高级应用/ex_06.c "./ch17_指针的高级应用/ex_06.c")|
|[练习7](./ch17_指针的高级应用/ex_07.md "./ch17_指针的高级应用/ex_07.md")|[练习8](./ch17_指针的高级应用/ex_08.md "./ch17_指针的高级应用/ex_08.md")|[练习9](./ch17_指针的高级应用/ex_09.md "./ch17_指针的高级应用/ex_09.md")|[练习10](./ch17_指针的高级应用/ex_10.c "./ch17_指针的高级应用/ex_10.c")|[练习11](./ch17_指针的高级应用/ex_11.md "./ch17_指针的高级应用/ex_11.md")|[练习12](./ch17_指针的高级应用/ex_12.c "./ch17_指针的高级应用/ex_12.c")|
|[练习13](./ch17_指针的高级应用/ex_13.c "./ch17_指针的高级应用/ex_13.c")|[练习14](./ch17_指针的高级应用/ex_14.c "./ch17_指针的高级应用/ex_14.c")|[练习15](./ch17_指针的高级应用/ex_15.md "./ch17_指针的高级应用/ex_15.md")|[练习16](./ch17_指针的高级应用/ex_16.md "./ch17_指针的高级应用/ex_16.md")|[练习17](./ch17_指针的高级应用/ex_17.c "./ch17_指针的高级应用/ex_17.c")|

### 第18章 声明

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch18_声明/ex_01.md "./ch18_声明/ex_01.md")|[练习2](./ch18_声明/ex_02.md "./ch18_声明/ex_02.md")|[练习3](./ch18_声明/ex_03.md "./ch18_声明/ex_03.md")|[练习4](./ch18_声明/ex_04.c "./ch18_声明/ex_04.c")|[练习5](./ch18_声明/ex_05.md "./ch18_声明/ex_05.md")|[练习6](./ch18_声明/ex_06.c "./ch18_声明/ex_06.c")|
|[练习7](./ch18_声明/ex_07.c "./ch18_声明/ex_07.c")|[练习8](./ch18_声明/ex_08.c "./ch18_声明/ex_08.c")|[练习9](./ch18_声明/ex_09.c "./ch18_声明/ex_09.c")|[练习10](./ch18_声明/ex_10.c "./ch18_声明/ex_10.c")|[练习11](./ch18_声明/ex_11.c "./ch18_声明/ex_11.c")|[练习12](./ch18_声明/ex_12.md "./ch18_声明/ex_12.md")|

### 第19章 程序设计

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch19_程序设计/ex_01.c "./ch19_程序设计/ex_01.c")|[练习2](./ch19_程序设计/ex_02.md "./ch19_程序设计/ex_02.md")|[练习3](./ch19_程序设计/ex_03.md "./ch19_程序设计/ex_03.md")|[练习4](./ch19_程序设计/ex_04.md "./ch19_程序设计/ex_04.md")|[练习5](./ch19_程序设计/ex_05.md "./ch19_程序设计/ex_05.md")|[练习6](./ch19_程序设计/ex_06.md "./ch19_程序设计/ex_06.md")|
|[练习7](./ch19_程序设计/ex_07.cpp "./ch19_程序设计/ex_07.cpp")|[练习8](./ch19_程序设计/ex_08.md "./ch19_程序设计/ex_08.md")|[练习9](./ch19_程序设计/ex_09.md "./ch19_程序设计/ex_09.md")|[练习10](./ch19_程序设计/ex_10.md "./ch19_程序设计/ex_10.md")|

### 第20章 低级程序设计

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch20_低级程序设计/ex_01.c "./ch20_低级程序设计/ex_01.c")|[练习2](./ch20_低级程序设计/ex_02.c "./ch20_低级程序设计/ex_02.c")|[练习3](./ch20_低级程序设计/ex_03.c "./ch20_低级程序设计/ex_03.c")|[练习4](./ch20_低级程序设计/ex_04.c "./ch20_低级程序设计/ex_04.c")|[练习5](./ch20_低级程序设计/ex_05.c "./ch20_低级程序设计/ex_05.c")|[练习6](./ch20_低级程序设计/ex_06.c "./ch20_低级程序设计/ex_06.c")|
|[练习7](./ch20_低级程序设计/ex_07.c "./ch20_低级程序设计/ex_07.c")|[练习8](./ch20_低级程序设计/ex_08.c "./ch20_低级程序设计/ex_08.c")|[练习9](./ch20_低级程序设计/ex_09.c "./ch20_低级程序设计/ex_09.c")|[练习10](./ch20_低级程序设计/ex_10.c "./ch20_低级程序设计/ex_10.c")|

### 第21章 标准库

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch21_标准库/ex_01.md "./ch21_标准库/ex_01.md")|[练习2](./ch21_标准库/ex_02.md "./ch21_标准库/ex_02.md")|[练习3](./ch21_标准库/ex_03.c "./ch21_标准库/ex_03.c")|[练习4](./ch21_标准库/ex_04.md "./ch21_标准库/ex_04.md")|[练习5](./ch21_标准库/ex_05.c "./ch21_标准库/ex_05.c")|

### 第22章 输入_输出

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch22_输入_输出/ex_01.md "./ch22_输入_输出/ex_01.md")|[练习2](./ch22_输入_输出/ex_02.md "./ch22_输入_输出/ex_02.md")|[练习3](./ch22_输入_输出/ex_03.c "./ch22_输入_输出/ex_03.c")|[练习4](./ch22_输入_输出/ex_04.c "./ch22_输入_输出/ex_04.c")|[练习5](./ch22_输入_输出/ex_05.c "./ch22_输入_输出/ex_05.c")|[练习6](./ch22_输入_输出/ex_06.c "./ch22_输入_输出/ex_06.c")|
|[练习7](./ch22_输入_输出/ex_07.c "./ch22_输入_输出/ex_07.c")|[练习8](./ch22_输入_输出/ex_08.c "./ch22_输入_输出/ex_08.c")|[练习9](./ch22_输入_输出/ex_09.c "./ch22_输入_输出/ex_09.c")|[练习10](./ch22_输入_输出/ex_10.md "./ch22_输入_输出/ex_10.md")|[练习11](./ch22_输入_输出/ex_11.md "./ch22_输入_输出/ex_11.md")|[练习12](./ch22_输入_输出/ex_12.c "./ch22_输入_输出/ex_12.c")|
|[练习13](./ch22_输入_输出/ex_13.c "./ch22_输入_输出/ex_13.c")|[练习14](./ch22_输入_输出/ex_14.c "./ch22_输入_输出/ex_14.c")|[练习15](./ch22_输入_输出/ex_15.c "./ch22_输入_输出/ex_15.c")|[练习16](./ch22_输入_输出/ex_16.c "./ch22_输入_输出/ex_16.c")|[练习17](./ch22_输入_输出/ex_17.c "./ch22_输入_输出/ex_17.c")|[练习18](./ch22_输入_输出/ex_18.c "./ch22_输入_输出/ex_18.c")|
|[练习19](./ch22_输入_输出/ex_19.md "./ch22_输入_输出/ex_19.md")|[练习20](./ch22_输入_输出/ex_20.c "./ch22_输入_输出/ex_20.c")|[练习21](./ch22_输入_输出/ex_21.md "./ch22_输入_输出/ex_21.md")|[练习22](./ch22_输入_输出/ex_22.c "./ch22_输入_输出/ex_22.c")|[练习23](./ch22_输入_输出/ex_23.c "./ch22_输入_输出/ex_23.c")|

### 第23章 库对数值和字符数据的支持

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch23_库对数值和字符数据的支持/ex_01.c "./ch23_库对数值和字符数据的支持/ex_01.c")|[练习2](./ch23_库对数值和字符数据的支持/ex_02.c "./ch23_库对数值和字符数据的支持/ex_02.c")|[练习3](./ch23_库对数值和字符数据的支持/ex_03.c "./ch23_库对数值和字符数据的支持/ex_03.c")|[练习4](./ch23_库对数值和字符数据的支持/ex_04.c "./ch23_库对数值和字符数据的支持/ex_04.c")|[练习5](./ch23_库对数值和字符数据的支持/ex_05.c "./ch23_库对数值和字符数据的支持/ex_05.c")|[练习6](./ch23_库对数值和字符数据的支持/ex_06.c "./ch23_库对数值和字符数据的支持/ex_06.c")|
|[练习7](./ch23_库对数值和字符数据的支持/ex_07.c "./ch23_库对数值和字符数据的支持/ex_07.c")|[练习8](./ch23_库对数值和字符数据的支持/ex_08.c "./ch23_库对数值和字符数据的支持/ex_08.c")|[练习9](./ch23_库对数值和字符数据的支持/ex_09.md "./ch23_库对数值和字符数据的支持/ex_09.md")|[练习10](./ch23_库对数值和字符数据的支持/ex_10.c "./ch23_库对数值和字符数据的支持/ex_10.c")|[练习11](./ch23_库对数值和字符数据的支持/ex_11.c "./ch23_库对数值和字符数据的支持/ex_11.c")|[练习12](./ch23_库对数值和字符数据的支持/ex_12.c "./ch23_库对数值和字符数据的支持/ex_12.c")|
|[练习13](./ch23_库对数值和字符数据的支持/ex_13.c "./ch23_库对数值和字符数据的支持/ex_13.c")|

### 第24章 错误处理

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch24_错误处理/ex_01.md "./ch24_错误处理/ex_01.md")|[练习2](./ch24_错误处理/ex_02.c "./ch24_错误处理/ex_02.c")|[练习3](./ch24_错误处理/ex_03.c "./ch24_错误处理/ex_03.c")|[练习4](./ch24_错误处理/ex_04.md "./ch24_错误处理/ex_04.md")|

### 第25章 国际化特性

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch25_国际化特性/ex_01.c "./ch25_国际化特性/ex_01.c")|[练习2](./ch25_国际化特性/ex_02.c "./ch25_国际化特性/ex_02.c")|[练习3](./ch25_国际化特性/ex_03.c "./ch25_国际化特性/ex_03.c")|[练习4](./ch25_国际化特性/ex_04.md "./ch25_国际化特性/ex_04.md")|

### 第26章 其他库函数

|A|L|L|E|X|E|
| :-: | :-: | :-: | :-: | :-: | :-: |
|[练习1](./ch26_其他库函数/ex_01.c "./ch26_其他库函数/ex_01.c")|[练习2](./ch26_其他库函数/ex_02.c "./ch26_其他库函数/ex_02.c")|[练习3](./ch26_其他库函数/ex_03.c "./ch26_其他库函数/ex_03.c")|[练习4](./ch26_其他库函数/ex_04.c "./ch26_其他库函数/ex_04.c")|[练习5](./ch26_其他库函数/ex_05.c "./ch26_其他库函数/ex_05.c")|[练习6](./ch26_其他库函数/ex_06.c "./ch26_其他库函数/ex_06.c")|
|[练习7](./ch26_其他库函数/ex_07.c "./ch26_其他库函数/ex_07.c")|[练习8](./ch26_其他库函数/ex_08.c "./ch26_其他库函数/ex_08.c")|[练习9](./ch26_其他库函数/ex_09.c "./ch26_其他库函数/ex_09.c")|[练习10](./ch26_其他库函数/ex_10.c "./ch26_其他库函数/ex_10.c")|[练习11](./ch26_其他库函数/ex_11.c "./ch26_其他库函数/ex_11.c")|[练习12](./ch26_其他库函数/ex_12.c "./ch26_其他库函数/ex_12.c")|
|[练习13](./ch26_其他库函数/ex_13.c "./ch26_其他库函数/ex_13.c")|[练习14](./ch26_其他库函数/ex_14.c "./ch26_其他库函数/ex_14.c")|



================================================
FILE: codes/CProgramming/ch02_C语言基本概念/build.sh
================================================
#! /bin/bash

# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]

all_c_files=`ls *.c`
exclude_files=""

is_exclude_file() {
	for file in $exclude_files; do
		if [ "$file" = "$1" ]; then
			return 0
		fi
	done

	return 1
}

main() {
	for c_file in $all_c_files; do
		exe_file=${c_file%%.c*}

		if [ "$1" == "clear" ]; then
			rm -f $exe_file
			continue
		fi

		if is_exclude_file $c_file; then
			continue
		fi

		if [ $exe_file -nt $c_file ] && [ "$1" != "rebuild" ]; then
			continue
		fi

		echo "[BUILDING] $c_file -> $exe_file"
		gcc $c_file -o $exe_file

		if [ "$?" != "0" ]; then
			return 1
		fi
	done

	return 0
}

main $1

exit $?


================================================
FILE: codes/CProgramming/ch02_C语言基本概念/celsius.c
================================================
/* Converts a Fahrenheit temperature to Celsius */

#include <stdio.h>

#define FREEZING_PT 32.0f
#define SCALE_FACTOR (5.0f / 9.0f)

int main()
{
	float fahrenheit, celsius;

	printf("Enter Fahrenheit temperature: ");
	scanf("%f", &fahrenheit);

	celsius = (fahrenheit - FREEZING_PT) * SCALE_FACTOR;

	printf("Celsius equivalent: %.1f\n", celsius);

	return 0;
}


================================================
FILE: codes/CProgramming/ch02_C语言基本概念/dweight.c
================================================
/* Computes the dimensional weight of a 12 * 10 * 8 box */

#include <stdio.h>

int main()
{
	int length, width, height, volume, weight;

	length = 12;
	width = 10;
	height = 8;

	volume = length * width * height;

	weight = (volume + 165) / 166;

	printf("Dimensions: %dx%dx%d\n", length, width, height);
	printf("Volume (cubic inches): %d\n", volume);
	printf("Dimensional weight (pounds): %d\n", weight);

	return 0;
}


================================================
FILE: codes/CProgramming/ch02_C语言基本概念/dweight2.c
================================================
/* Computes the dimensional weight of a 12 * 10 * 8 box */

#include <stdio.h>

int main()
{
	int length, width, height, volume, weight;

	printf("Enter length of box: ");
	scanf("%d", &length);
	printf("Enter width of box: ");
	scanf("%d", &width);
	printf("Enter height of box: ");
	scanf("%d", &height);

	volume = length * width * height;

	weight = (volume + 165) / 166;

	printf("Volume (cubic inches): %d\n", volume);
	printf("Dimensional weight (pounds): %d\n", weight);

	return 0;
}


================================================
FILE: codes/CProgramming/ch02_C语言基本概念/ex_01.c
================================================
/*
 * 建立并运行由 Kernighan 和 Ritchie 编写的著名的”hello, world“程序:
 *
 * #include <stdio.h>
 *
 * main()
 * {
 *     printf("hello, world\n");
 * }
 *
 * 在编译时是否有警告信息?如果有,需要如何进行修改呢?
 */

/*
 * main 函数没有声明返回类型: warning: return type defaults to ‘int’ [-Wreturn-type]
 *
 * main 函数结尾没有 return 语句: warning: control reaches end of non-void function [-Wreturn-type]
 */

#include <stdio.h>

int main()
{
	printf("hello, world\n");

	return 0;
}


================================================
FILE: codes/CProgramming/ch02_C语言基本概念/ex_02.c
================================================
/*
思考下面的程序:

#include <stdio.h>

main()
{
	printf("Parkinson's Law:\nWork expands so as to ");
	printf("fill the time\n");
	printf("available for its completion.\n");
	return 0;
}

(a) 请指出程序中的指令和语句
(b) 程序的输出是什么?
*/

/*
(a) 程序包含了一条指令(#include),四条语句(三个printf调用,一个return)
(b) 
Parkinson's Law:
Work expands so as to fill the time
available for its completion.

*/

#include <stdio.h>

int main()
{
	printf("Parkinson's Law:\nWork expands so as to ");
	printf("fill the time\n");
	printf("available for its completion.\n");
	return 0;
}


================================================
FILE: codes/CProgramming/ch02_C语言基本概念/ex_03.c
================================================
/*
 * 编写一个程序,程序要使用 printf 在屏幕上显示出下面的图形:
 *
 *        *
 *       *
 *      *
 * *   *
 *  * *
 *   *
 */

#include <stdio.h>

int main()
{
	printf("       *\n");
	printf("      *\n");
	printf("     *\n");
	printf("*   *\n");
	printf(" * *\n");
	printf("  *\n");

	return 0;
}


================================================
FILE: codes/CProgramming/ch02_C语言基本概念/ex_04.c
================================================
/*
通过下列方法缩写程序dweight.c: (1)用初始化语句替换对变量height、length和width的赋值语句;
(2)去掉变量weight,在最后的printf语句中计算(valoume + 165) / 166。
*/

/* Computes the dimensional weight of a 12 * 10 * 8 box */

#include <stdio.h>

int main()
{
	int length = 12, width = 10, height = 8, volume;

	volume = length * width * height;

	printf("Dimensions: %dx%dx%d\n", length, width, height);
	printf("Volume (cubic inches): %d\n", volume);
	printf("Dimensional weight (pounds): %d\n", (volume + 165) / 166);

	return 0;
}


================================================
FILE: codes/CProgramming/ch02_C语言基本概念/ex_05.c
================================================
/*
 * 编写一个计算球体体积的程序,其中球体半径为10m,参考公式v=4/3πr3。注意,分数4/3应写为
 * 4.0/3.0。(如果分数写成4/3,会产生什么结果?)
 */

/*
 * 如果写成4/3,那么结果恒等于1,不是正确的结果。
 */

#include <stdio.h>

#define PI 3.14

int main()
{
	float radius, volume;

	radius = 10;
	volume = 4.0 / 3.0 * PI * radius * radius * radius;

	printf("volume: %.2f\n", volume);

	return 0;
}


================================================
FILE: codes/CProgramming/ch02_C语言基本概念/ex_06.c
================================================
/*
 * 编写一个程序用来声明几个 int 型和 float 型变量,不对这些变量进行初始化,然后打印出它们的值。
 * 这些值是否有规律?(通常情况下没有)
 */

/*
 * 没有规律。
 */

#include <stdio.h>

int main()
{
	int i, j, k;
	float x, y;

	printf("i: %d\n", i);
	printf("j: %d\n", j);
	printf("k: %d\n", k);

	printf("x: %f\n", x);
	printf("y: %f\n", y);

	return 0;
}


================================================
FILE: codes/CProgramming/ch02_C语言基本概念/ex_07.c
================================================
/*
 * 修改练习5中的程序,使用户可以自行录入球体的半径。
 */

#include <stdio.h>

#define PI 3.14

int main()
{
	float radius, volume;

	printf("Enter radius: ");
	scanf("%f", &radius);

	volume = 4.0 / 3.0 * PI * radius * radius * radius;

	printf("volume: %.2f\n", volume);

	return 0;
}


================================================
FILE: codes/CProgramming/ch02_C语言基本概念/ex_08.c
================================================
/*
 * 编写一个程序,要求用户输入一个美金数量,然后显示出加了5%税率的相应金额。格式如下所示:
 * Enter a dollar amount: 100.00
 * With tax added: 105.00
 */

#include <stdio.h>

#define TAX_RATE 0.05

int main()
{
	float amount;

	printf("Enter a dollar amount: ");
	scanf("%f", &amount);

	printf("With tax added: %.2f\n", amount + amount * TAX_RATE);

	return 0;
}


================================================
FILE: codes/CProgramming/ch02_C语言基本概念/ex_09.md
================================================
修改练习7,要求用名为 PI 的宏表示π的值。

见练习7。


================================================
FILE: codes/CProgramming/ch02_C语言基本概念/ex_10.c
================================================
/*
 * 判断下列哪些是不合法的C语言标识符?
 * (a) 100_bottles
 * (b) _100_bottles
 * (c) one_hundred_bottles
 * (d) bottles_by_the_hundred
 */

int main()
{
	/* int 100_bottles; */	/* 不合法 */
	int _100_bottles;
	int one_hundred_bottles;
	int bottles_by_the_hundred;

	return 0;
}


================================================
FILE: codes/CProgramming/ch02_C语言基本概念/ex_11.md
================================================
判断下列哪些是C语言的关键字?

(a) for 是

(b) If 不是

(c) main 不是

(d) printf 不是

(e) while 是


================================================
FILE: codes/CProgramming/ch02_C语言基本概念/ex_12.md
================================================
下面的语句中有多少记号?

```c
a=(3*q-p*p)/3;
```

有:

1. a
2. (
3. 3
4. \*
5. q
6. -
7. p
8. \*
9. p
10. )
11. /
12. 3
13. ;


================================================
FILE: codes/CProgramming/ch02_C语言基本概念/ex_13.md
================================================
在练习12的记号之间插入足够多的空格,使得上面的语句易于阅读。

```c
a = (3 * q - p * p) / 3;
```


================================================
FILE: codes/CProgramming/ch02_C语言基本概念/pun.c
================================================
/*
 * Name: pun.c
 * Purpose: Prints a bad pun.
 * Author: liudiwen
 * Date written: 28/8/2018
 */

#include <stdio.h>

int main()
{
	printf("To C, or not to C, that is the question.\n");
	return 0;
}


================================================
FILE: codes/CProgramming/ch03_格式化的输入输出/addfrac.c
================================================
/* Add two fractions */

#include <stdio.h>

int main()
{
    int num1, denom1;
    int num2, denom2;
    int result_num, result_denom;

    printf("Enter first fraction: ");
    scanf("%d/%d", &num1, &denom1);

    printf("Enter second fraction: ");
    scanf("%d/%d", &num2, &denom2);

    result_num = num1 * denom2 + num2 * denom1;
    result_denom = denom1 * denom2;

    printf("The sum is: %d/%d\n", result_num, result_denom);

    return 0;
}



================================================
FILE: codes/CProgramming/ch03_格式化的输入输出/build.sh
================================================
#! /bin/bash

# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]

all_c_files=`ls *.c`
exclude_files=""

is_exclude_file() {
	for file in $exclude_files; do
		if [ "$file" = "$1" ]; then
			return 0
		fi
	done

	return 1
}

main() {
	for c_file in $all_c_files; do
		exe_file=${c_file%%.c*}

		if [ "$1" == "clear" ]; then
			rm -f $exe_file
			continue
		fi

		if is_exclude_file $c_file; then
			continue
		fi

		if [ $exe_file -nt $c_file ] && [ "$1" != "rebuild" ]; then
			continue
		fi

		echo "[BUILDING] $c_file -> $exe_file"
		gcc $c_file -o $exe_file

		if [ "$?" != "0" ]; then
			return 1
		fi
	done

	return 0
}

main $1

exit $?


================================================
FILE: codes/CProgramming/ch03_格式化的输入输出/ex_01.c
================================================
/*
 * 下面的 printf 函数调用产生的输出分别是什么?
 */

#include <stdio.h>

int main()
{
	// `代表空格

	// a: ````86,1040
	printf("%6d,%4d", 86, 1040);
	putchar('\n');

	// b: `3.02530e+01
	printf("%12.5e", 30.253);
	putchar('\n');

	// c: 83.1620
	printf("%.4f", 83.162);
	putchar('\n');

	// d: 1e-06
	printf("%-6.2g", .0000009979);
	putchar('\n');

	return 0;
}


================================================
FILE: codes/CProgramming/ch03_格式化的输入输出/ex_02.c
================================================
/*
 * 编写 printf 函数调用以下列格式来显示 float 型变量x:
 */

#include <stdio.h>

int main()
{
	float x = 3.14;

	// (a) 指数表示形式;最小为8的字段宽度内左对齐;小数点后保留1位数字
	printf("%-8.1e\n", x);

	// (b) 指数表示形式;最小为10的字段宽度内右对齐;小数点后保留6位数字
	printf("%10.6e\n", x);

	// (c) 定点十进制表示形式;最小为8的字段宽度内左对齐;小数点后保留3位数字
	printf("%-8.3f\n", x);

	// (d) 定点十进制表示形式;最小为6的字段宽度内右对齐;小数点后无数字
	printf("%6.0f\n", x);

	return 0;
}


================================================
FILE: codes/CProgramming/ch03_格式化的输入输出/ex_03.c
================================================
/*
 * 说明下列每对 scanf 格式串是否等价?如果不等价,请指出它们的差异。
 */

#include <stdio.h>

int main()
{
	int i, j, k;
	float x, y;

	// (a) "%d" 与 " %d" 等价
	//scanf("%d", &i); printf("%d\n", i);
	//scanf(" %d", &i); printf("%d\n", i);

	// (b) "%d-%d-%d" 与 "%d -%d -%d" 不等价,不能用第二个格式串的输入代替第一个
	//scanf("%d-%d-%d", &i, &j, &k); printf("%d %d %d\n", i, j, k);
	//scanf("%d -%d -%d", &i, &j, &k); printf("%d %d %d\n", i, j, k);
	
	// (c) “%f” 与 "%f " 不等价,第二个格式串的末尾是空格,必须读取一个非空白字符
	//scanf("%f", &x); printf("%f\n", x);
	//scanf("%f ", &x); printf("%f\n", x);

	// (d) "%f,%f" 与 "%f, %f" 等价
	scanf("%f,%f", &x, &y); printf("%f %f\n", x, y);
	scanf("%f, %f", &x, &y); printf("%f %f\n", x, y);
	

	return 0;
}


================================================
FILE: codes/CProgramming/ch03_格式化的输入输出/ex_04.c
================================================
/*
 * 编写一个程序,接收用户录入的日期信息并且将其显示出来。其中,输入日期的形式为月/日/年(即
 * mm/dd/yy),输出日期的形式为年月日(即yymmdd)。格式如下所示:
 * Enter a date (mm/dd/yy): 2/17/96
 * You entered the date 960217
 */

#include <stdio.h>

int main()
{
	int yy, mm, dd;

	printf("Enter a date (mm/dd/yy): ");
	scanf("%d/%d/%d", &mm, &dd, &yy);

	printf("You entered the date %.2d%.2d%.2d\n", yy, mm, dd);

	return 0;
}


================================================
FILE: codes/CProgramming/ch03_格式化的输入输出/ex_05.c
================================================
/*
 * 编写一个程序,对用户录入的产品信息进行格式化。程序运行后需有如下会话:
 * Enter item number: 583
 * Enter unit price: 13.5
 * Enter purchase date (mm/dd/yy): 10/24/95
 * Item    Unit    Purchase
 *         Price   Date
 * 583     $ 13.50 10/24/95
 *
 * 其中,数字项和日期项采用左对齐方式;单位价格采用右对齐方式。美元数量的最大取值为9999.99。
 * 提示:使用制表符控制列坐标。
 */

#include <stdio.h>

int main()
{
	int item_number;
	float unit_price;
	int mm, dd, yy;

	/* input */
	printf("Enter item number: ");
	scanf("%d", &item_number);

	printf("Enter unit price: ");
	scanf("%f", &unit_price);

	printf("Enter purchase date (mm/dd/yy): ");
	scanf("%d/%d/%d", &mm, &dd, &yy);

	/* output */
	printf("Item\tUnit\t\tPurchase\n");
	printf("\tPrice\t\tDate\n");
	printf("%-d\t$ %.2f\t\t%-d/%-d/%-d\n", item_number, unit_price, mm, dd, yy);
	

	return 0;
}


================================================
FILE: codes/CProgramming/ch03_格式化的输入输出/ex_06.c
================================================
/*
 * 图书用国际标准图书编号( ISBN )进行标识,如0-393-30375-6。编号中的第一个数字说明编写书籍
 * 所用的语言(例如,0表示英语,3表示德语)。接下来的一组数字表示出版社(例如,393是 W.W.Norton
 * 出版社的编号),而随后的数字则是出版社设定的,用来识别图书(例如,30375是 Stephen Jay Gould
 * 的 The Flamingo's Smile 一书的编号)。最后,结尾数字是“校验数字”,它用来验证前面数字的准确性。
 * 编写一个程序来分解用户录入的 ISBN 信息,格式如下:
 * Enter ISBN: 0-393-30375-6
 * Language: 0
 * Publisher: 393
 * Book Number: 30375
 * Check digit: 6
 */

#include <stdio.h>

int main()
{
	int language, publisher, book_number, check_digit;

	printf("Enter ISBN: ");
	scanf("%d-%d-%d-%d", &language, &publisher, &book_number, &check_digit);

	printf("Language: %d\n", language);
	printf("Publisher: %d\n", publisher);
	printf("Book Number: %d\n", book_number);
	printf("Check digit: %d\n", check_digit);
	
	return 0;
}


================================================
FILE: codes/CProgramming/ch03_格式化的输入输出/ex_07.c
================================================
/*
 * 假设 scanf 函数调用的格式如下:
 * scanf("%d%f%d", &i, &x, &j);
 * 如果用户录入如下信息:
 * 10.3 5 6
 * 调用执行后,变量i、x和j的值分别是多少?(假设变量i和变量j都是 int 型,而变量x是 float 型。)
 */

#include <stdio.h>

int main()
{
	int i, j;
	float x;

	scanf("%d%f%d", &i, &x, &j);
	printf("%d %f %d\n", i, x, j); // i = 10, x = 0.3, y = 5

	return 0;
}


================================================
FILE: codes/CProgramming/ch03_格式化的输入输出/ex_08.c
================================================
/*
 * 假设 scanf 函数调用的格式如下:
 * scanf("%f%d%f", &x, &i, &y);
 * 如果用户录入如下信息:
 * 12.3 45.6 789
 * 调用执行后,变量x、i和y的值分别是多少?(假设变量x和变量y都是 float 型,而变量i是 int 型。)
 */

#include <stdio.h>

int main()
{
	int i;
	float x, y;

	scanf("%f%d%f", &x, &i, &y);
	printf("%f %d %f\n", x, i, y); // x = 12.3, i = 45, y = 0.6

	return 0;
}


================================================
FILE: codes/CProgramming/ch03_格式化的输入输出/example_escape_sequence.c
================================================
/*
 * 转移序列案例,见 p25
 */

#include <stdio.h>

int main()
{
	printf("Item\tUnit\tPurchase\n\tPrice\tDate\n");

	printf("\"Hello!\"\n");

	printf("\\");	/* prints one \ character */

	return 0;
}


================================================
FILE: codes/CProgramming/ch03_格式化的输入输出/example_scanf.c
================================================
/*
 * scanf 案例,见 p26
 */

#include <stdio.h>

int main()
{
	int i, j;
	float x, y;
	
	scanf("%d%d%f%f", &i, &j, &x, &y);

	printf("i: %d\n", i);
	printf("j: %d\n", j);
	printf("x: %f\n", x);
	printf("y: %f\n", y);

	return 0;
}


================================================
FILE: codes/CProgramming/ch03_格式化的输入输出/stocks.c
================================================
/*
 * Computes the value of stock holdings
 */

#include <stdio.h>

int main()
{
	int price, shares;
	float num, denom, value;

	printf("Enter share price (must include a fraction): ");
	scanf("%d%f/%f", &price, &num, &denom);

	printf("Enter number of shares: ");
	scanf("%d", &shares);

	value = (price + num / denom) * shares;
	
	printf("Value of holdings: $%.2f\n", value);

	return 0;
}


================================================
FILE: codes/CProgramming/ch03_格式化的输入输出/tprintf.c
================================================
/* Print int and float values in various formats */

#include <stdio.h>

int main()
{
    int i;
    float x;

    i = 40;
    x = 839.21f;

    printf("|%d|%5d|%-5d|%5.3d|\n", i, i, i, i);
    printf("|%10.3f|%10.3e|%10g|\n", x, x, x);

    return 0;
}


================================================
FILE: codes/CProgramming/ch04_表达式/build.sh
================================================
#! /bin/bash

# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]

all_c_files=`ls *.c`
exclude_files=""

is_exclude_file() {
	for file in $exclude_files; do
		if [ "$file" = "$1" ]; then
			return 0
		fi
	done

	return 1
}

main() {
	for c_file in $all_c_files; do
		exe_file=${c_file%%.c*}

		if [ "$1" == "clear" ]; then
			rm -f $exe_file
			continue
		fi

		if is_exclude_file $c_file; then
			continue
		fi

		if [ $exe_file -nt $c_file ] && [ "$1" != "rebuild" ]; then
			continue
		fi

		echo "[BUILDING] $c_file -> $exe_file"
		gcc $c_file -o $exe_file

		if [ "$?" != "0" ]; then
			return 1
		fi
	done

	return 0
}

main $1

exit $?


================================================
FILE: codes/CProgramming/ch04_表达式/ex_01.c
================================================
/*
 * 列出下列每段代码的输出结果。假设i、j和k都是 int 型变量。
 */

#include <stdio.h>

int main()
{
	int i, j, k;

	/*
	 * (a) 1 2
	 */
	{
		i = 5; j = 3;
		printf("%d %d", i / j, i % j);
	}
	putchar('\n');

	/*
	 * (b) 0
	 */
	{
		i = 2; j = 3;
		printf("%d", (i + 10) % j);
	}
	putchar('\n');

	/*
	 * (c) 1
	 */
	{
		i = 7; j = 8; k = 9;
		printf("%d", (i + 10) % k / j);
	}
	putchar('\n');

	/*
	 * (d) 0
	 */
	{
		i = 1; j = 2; k = 3;
		printf("%d", (i + 5) % (j + 2) / k);
	}
	putchar('\n');

	return 0;
}


================================================
FILE: codes/CProgramming/ch04_表达式/ex_02.c
================================================
/*
 * 如果i和j都是正整数,是否(-i)/j的值和-(i/j)的值始终一样?验证你的答案。
 *
 * 一样。
 */

#include <stdio.h>

int main()
{
	int i, j;

	printf("Enter i: ");
	scanf("%d", &i);

	printf("Enter j: ");
	scanf("%d", &j);

	printf("(-i)/j: %d\n", (-i)/j);
	printf("-(i/j): %d\n", -(i/j));

	return 0;
}


================================================
FILE: codes/CProgramming/ch04_表达式/ex_03.c
================================================
/*
 * 编写程序实现数字反向,即根据用户输入的两位数,反向显示出该数相应位上数字。要求程序执行过
 * 程中需要具有下列显示信息。
 *
 * Enter a two-degit number: 28
 * The reversal is: 82
 */

#include <stdio.h>

int main()
{
	int n;

	printf("Enter a two-digit number: ");
	scanf("%d", &n);

	printf("The reversal is: %d%d\n", n%10, n/10);

	return 0;
}


================================================
FILE: codes/CProgramming/ch04_表达式/ex_04.c
================================================
/*
 * 扩展练习3中的程序使其可以处理三位数的反向。
 */

#include <stdio.h>

int main()
{
	int n;

	printf("Enter a three-digit number: " );
	scanf("%d", &n);

	printf("The reversal is: %d%d%d", n%100%10, n%100/10, n/100);

	return 0;
}


================================================
FILE: codes/CProgramming/ch04_表达式/ex_05.c
================================================
/*
 * 重新编写练习4中的程序,使新程序不用数学式的分割数字方法就可以显示出三位的反向数。提示:
 * 复习程序upc.c。
 */

#include <stdio.h>

int main()
{
	int d1, d2, d3;

	printf("Enter a three-digit number: ");
	scanf("%1d%1d%1d", &d1, &d2, &d3);

	printf("The reversal is: %d%d%d\n", d3, d2, d1);

	return 0;
}


================================================
FILE: codes/CProgramming/ch04_表达式/ex_06.c
================================================
/*
 * 列出下列每段代码的输出结果。假设i、j和k都是 int 型变量。
 */

#include <stdio.h>

int main()
{
	int i, j, k;

	/*
	 * (a) 63 8
	 */
	{
		i = 7; j = 8;
		i *= j + 1;
		printf("%d %d", i, j);
	}
	putchar(10);

	/*
	 * (b) 3 2 1
	 */
	{
		i = j = k = 1;
		i += j += k;
		printf("%d %d %d", i, j, k);
	}
	putchar(10);

	/*
	 * (c) 2 -1 3
	 */
	{
		i = 1; j = 2; k = 3;
		i -= j -= k;
		printf("%d %d %d", i, j, k);
	}
	putchar(10);

	/*
	 * (d) 0 0 0
	 */
	{
		i = 2; j = 1; k = 0;
		i *= j *= k;
		printf("%d %d %d", i, j, k);
	}
	putchar(10);

	return 0;
}


================================================
FILE: codes/CProgramming/ch04_表达式/ex_07.c
================================================
/*
 * 列出下列每段代码的输出结果。假设i、j和k都是 int 型变量。
 */

#include <stdio.h>

int main()
{
	int i, j, k;

	/*
	 * (a) 0 2
	 */
	{
		i = 1;
		printf("%d ", i++ - 1);
		printf("%d", i);
	}
	putchar(10);

	/*
	 * (b) 4 11 6
	 */
	{
		i = 10; j = 5;
		printf("%d ", i++ - ++j);
		printf("%d %d", i, j);
	}
	putchar(10);

	/*
	 * (c) 0 8 7
	 */
	{
		i = 7; j = 8;
		printf("%d ", i++ - --j);
		printf("%d %d", i, j);
	}
	putchar(10);

	/*
	 * (d) 3 4 5 4
	 */
	{
		i = 3; j = 4; k = 5;
		printf("%d ", i++ - j++ + --k);
		printf("%d %d %d", i, j, k);
	}
	putchar(10);

	return 0;
}


================================================
FILE: codes/CProgramming/ch04_表达式/ex_08.c
================================================
/*
 * 表达式++i和i++中只有一个是与表达式(i += 1)完全相同的,哪一个是呢?验证你的答案。
 *
 * ++i
 */

#include <stdio.h>

int main()
{
	int i;

	i = 1;
	printf("%d\n", i++);

	i = 1;
	printf("%d\n", ++i);

	i = 1;
	printf("%d\n", (i += 1));

	return 0;
}


================================================
FILE: codes/CProgramming/ch04_表达式/ex_09.md
================================================
用圆括号来显示C语言编译器解释下列表达式的方法。

(a) a * b - c * d + e

((a * b) - (c * d)) + e

(b) a / b % c / d

((a / b) % c) / d

(c) - a - b + c - + d

(((- a) - b) + c) - (+ d)

(d) a * - b / c - d

((a * (- b)) / c) - d


================================================
FILE: codes/CProgramming/ch04_表达式/ex_10.c
================================================
/*
 * 表达式(i++)+ (i--)共有多少种可能的值?假设i初始值为1,这些值都是什么?
 *
 * 先执行第一个表达式,且i已修改,结果为 1 + 2 = 3
 * 先执行第一个表达式,但i未修改,结果为 1 + 1 = 2
 * 先执行第二个表达式,且i已修改,结果为 0 + 1 = 1
 * 先执行第二个表达式,但i未修改,结果为 1 + 1 = 2
 *
 * 当前环境,实际运行结果是3
 */

#include <stdio.h>

int main()
{
	int res, i = 1;

	res = (i++)+ (i--);

	printf("%d\n", res);

	return 0;
}


================================================
FILE: codes/CProgramming/ch04_表达式/ex_11.md
================================================
请描述执行下列每条表达式语句后的效果。(假设i的初始值为1,j的初始值为2。)

(a) i += j; 表达式结果为3,副作用是把i的值修改成3

(b) i--; 表达式的结果为1,副作用是把i的值修改成0

(b) i * j / i; 表达式的结果为2,结果被丢弃

(d) i % ++j; 表达式的结果为1,副作用是把j的值修改成3


================================================
FILE: codes/CProgramming/ch04_表达式/upc.c
================================================
/* Computes a Universal Product Code check digit */

/* Enter: 0 13800 15173 
 * Check: 5
 */

#include <stdio.h>

int main()
{
	int d, i1, i2, i3, i4, i5, j1, j2, j3, j4, j5;
	int first_sum, second_sum, total, check_digit;

	printf("Enter the first (single) digit: ");
	scanf("%1d", &d);

	printf("Enter first group of five digits: ");
	scanf("%1d%1d%1d%1d%1d", &i1, &i2, &i3, &i4, &i5);

	printf("Enter second group of five digits: ");
	scanf("%1d%1d%1d%1d%1d", &j1, &j2, &j3, &j4, &j5);

	first_sum = d + i2 + i4 + j1 + j3 + j5;
	second_sum = i1 + i3 + i5 + j2 + j4;

	total = 3 * first_sum + second_sum;

	check_digit = 9 - ((total - 1) % 10);

	printf("Check digit: %d\n", check_digit);

	return 0;
}


================================================
FILE: codes/CProgramming/ch05_选择语句/broker.c
================================================
/* Calculates a brokers commision */

#include <stdio.h>

int main()
{
	float value, commision;

	printf("Enter value of trade: ");
	scanf("%f", &value);

	if (value < 2500)
		commision = 30.0f + 0.01 * 0.17 * value;
	else if (value < 6250)
		commision = 56.0f + 0.01 * 0.66 * value;
	else if (value < 20000)
		commision = 76.0f + 0.01 * 0.34 * value;
	else if (value < 50000)
		commision = 100 + 0.01 * 0.22 * value;
	else if (value < 500000)
		commision = 155 + 0.01 * 0.11 * value;
	else
		commision = 255 + 0.01 * 0.09 * value;

	if (commision < 39)
		commision = 39;

	printf("The commision is: $%.2f\n", commision);

	return 0;
}


================================================
FILE: codes/CProgramming/ch05_选择语句/build.sh
================================================
#! /bin/bash

# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]

all_c_files=`ls *.c`
exclude_files=""

is_exclude_file() {
	for file in $exclude_files; do
		if [ "$file" = "$1" ]; then
			return 0
		fi
	done

	return 1
}

main() {
	for c_file in $all_c_files; do
		exe_file=${c_file%%.c*}

		if [ "$1" == "clear" ]; then
			rm -f $exe_file
			continue
		fi

		if is_exclude_file $c_file; then
			continue
		fi

		if [ $exe_file -nt $c_file ] && [ "$1" != "rebuild" ]; then
			continue
		fi

		echo "[BUILDING] $c_file -> $exe_file"
		gcc $c_file -o $exe_file

		if [ "$?" != "0" ]; then
			return 1
		fi
	done

	return 0
}

main $1

exit $?


================================================
FILE: codes/CProgramming/ch05_选择语句/date.c
================================================
/* Print a date in legal form */

/* 如输入7/19/14,输出Dated this 19th day of July, 2014. */

#include <stdio.h>

int main()
{
	int month, day, year;

	printf("Enter date(mm/dd/yy): ");
	scanf("%d/%d/%d", &month, &day, &year);

	printf("Dated this %d", day);

	switch(day) 
	{
		case 1:
		case 21:
			printf("st");
			break;

		case 2:
		case 22:
			printf("nd");
			break;

		case 3:
		case 23:
			printf("rd");
			break;

		default:
			printf("th");
			break;
	}

	printf(" day of ");

	switch(month) 
	{
		case 1: printf("January"); break;
		case 2: printf("February"); break;
		case 3: printf("March"); break;
		case 4: printf("April"); break;
		case 5: printf("May"); break;
		case 6: printf("June"); break;
		case 7: printf("July"); break;
		case 8: printf("August"); break;
		case 9: printf("September"); break;
		case 10: printf("October"); break;
		case 11: printf("November"); break;
		case 12: printf("December"); break;
	}

	printf(", 20%.2d.", year);

	return 0;
}


================================================
FILE: codes/CProgramming/ch05_选择语句/ex_01.c
================================================
/*
 * 下列代码段对关系运算符和判等运算符进行了说明。假设i、j和k都是 int 型变量,请列出每道题中
 * 的输出结果。
 */

#include <stdio.h>

int main()
{
	int i, j, k;

	// (a) 1
	{
		i = 2; j = 3;
		k = i * j == 6;
		printf("%d", k);
	}
	putchar(10);

	// (b) 1
	{
		i = 5; j = 10; k = 1;
		printf("%d", k > i < j);
	}
	putchar(10);

	// (c) 1
	{
		i = 3; j = 2; k = 1;
		printf("%d", i < j == j < k);
	}
	putchar(10);

	// (d) 1
	{
		i = 1; j = 2; k = 3;
		printf("%d", i < j || k);
	}
	putchar(10);

	return 0;
}


================================================
FILE: codes/CProgramming/ch05_选择语句/ex_02.c
================================================
/*
 * 下列代码段对逻辑运算符进行了说明。假设i、j和k都是 int 型变量,请列出每道题中的输出结果。
 */

#include <stdio.h>

int main()
{
	int i, j, k;

	// (a) 1
	{
		i = 10; j = 5;
		printf("%d", !i < j);
	}
	putchar(10);

	// (b) 1
	{
		i = 2; j = 1;
		printf("%d", !!i + !j);
	}
	putchar(10);

	// (c) 1
	{
		i = 5; j = 0; k = -5;
		printf("%d", i && j || k);
	}
	putchar(10);

	// (d) 1
	{
		i = 1; j = 2; k = 3;
		printf("%d", i < j || k);
	}
	putchar(10);

	return 0;
}


================================================
FILE: codes/CProgramming/ch05_选择语句/ex_03.c
================================================
/*
 * 下列代码对逻辑表达式的短路行为进行了说明。假设i、j和k都是 int 型变量,请列出每道题中的
 * 输出结果。
 */

#include <stdio.h>

int main()
{
	int i, j, k;

	// (a) 1
	{
		i = 3; j = 4; k = 5;
		printf("%d", i < j || ++j < k);
	}
	putchar(10);

	// (b) 07 8 9
	{
		i = 7; j = 8; k = 9;
		printf("%d", i - 7 && j ++ < k);
		printf("%d %d %d", i, j, k);
	}
	putchar(10);

	// (c) 18 8 9
	{
		i = 7; j = 8; k = 9;
		printf("%d", (i = j) || (j = k));
		printf("%d %d %d", i, j, k);
	}
	putchar(10);

	// (d) 12 1 1
	{
		i = 1; j = 1; k = 1;
		printf("%d", ++i || ++j && ++k);
		printf("%d %d %d", i, j, k);
	}
	putchar(10);

	return 0;
}


================================================
FILE: codes/CProgramming/ch05_选择语句/ex_04.c
================================================
/*
 * 编写一个单独的表达式,要求这个表达式的值根据i是否小于、等于或大于j而分别为-1、0或+1。
 */ 

#include <stdio.h>

int main()
{
	int i, j, res;

	j = 10;

	printf("j = %d, Enter i: ", j);
	scanf("%d", &i);

	res = (i < j) ? -1 : (i == j ? 0 : 1);

	printf("res: %d\n", res);

	return 0;
}


================================================
FILE: codes/CProgramming/ch05_选择语句/ex_05.c
================================================
/*
 * 编写一个程序用来确定一个数的位数:
 *
 * Enter a number: 374
 * The number 374 has 3 digits
 *
 * 假设输入的数最多不超过四位。提示:利用 if 语句进行数的判定。例如,如果数是在0到9之间的,那
 * 么位数为一。如果数是在10到99之间的,那么位数为二。
 */

#include <stdio.h>

int main()
{
	int n, digits;

	printf("Enter a number: ");
	scanf("%d", &n);

	if (n >= 0 && n <= 9) digits = 1;
	else if (n >= 10 && n <= 99) digits = 2;
	else if (n >= 100 && n <= 999) digits = 3;
	else digits = 4;

	printf("The number %d has %d digits\n", n, digits);

	return 0;
}


================================================
FILE: codes/CProgramming/ch05_选择语句/ex_06.c
================================================
/*
 * 编写一个程序,要求用户输入24小时制的时间,然后显示12小时制的格式:
 *
 * Enter a 24-hour time: 21:11
 * Equivalent 12-hour time: 9:11 PM
 *
 * 注意不要把12:00显示成0:00
 */

#include <stdio.h>

int main()
{
	int hh, mm;

	printf("Enter a 24-hour time: ");
	scanf("%d:%d", &hh, &mm);

	if (hh <= 12)
		printf("Equivalent 12-hour time: %d:%d AM\n", hh, mm);
	else
		printf("Equivalent 12-hour time: %d:%d PM\n", hh - 12, mm);

	return 0;
}


================================================
FILE: codes/CProgramming/ch05_选择语句/ex_07.c
================================================
/*
 * 同时采用下列两种变化对程序 borker.c 进行修改。
 *
 * (a)不再直接用交易额,而是要求用户输入股票的数量和每股的价格。
 * (b)增加语句用来计算经纪人竞争对手的佣金(少于2000股时佣金为每股33美元+3美分,2000股或更
 * 大股时佣金为每股33美元+2美分)。显示原有的经纪人的佣金的同时,显示竞争对手的佣金。
 */

#include <stdio.h>

int main()
{
	int stock_num;
	float stock_value, value, commision, competitor_commision;

	printf("Enter stock_num: ");
	scanf("%d", &stock_num);
	printf("Enter stock_value: ");
	scanf("%f", &stock_value);

	value = stock_num * stock_value;

	if (value < 2500)
		commision = 30.0f + 0.01 * 0.17 * value;
	else if (value < 6250)
		commision = 56.0f + 0.01 * 0.66 * value;
	else if (value < 20000)
		commision = 76.0f + 0.01 * 0.34 * value;
	else if (value < 50000)
		commision = 100 + 0.01 * 0.22 * value;
	else if (value < 500000)
		commision = 155 + 0.01 * 0.11 * value;
	else
		commision = 255 + 0.01 * 0.09 * value;

	if (commision < 39)
		commision = 39;

	{
		/* calc for competitor commision */
		if (stock_num < 2000)
			competitor_commision = 33.03 * stock_num;
		else
			competitor_commision = 33.02 * stock_num;
	}

	printf("The commision is: $%.2f\n", commision);
	printf("The competition commision is: %.2f\n", competitor_commision);

	return 0;
}


================================================
FILE: codes/CProgramming/ch05_选择语句/ex_08.c
================================================
/*
 * 下面是蒲福风力的简单版本。蒲福风力等级是用于测量风力的。
 *
 *     速率(=海里/小时)    描述
 *     小于1                 Calm(无风)
 *     1~3                   Light air(轻风)
 *     4~27                  Breeze(微风)
 *     28~47                 Gale(大风)
 *     48~63                 Storm(暴风)
 *     大于63                Hurricane(飓风)
 *
 * 编写一个程序,要求用户输入风速(按照海里/小时),然后显示相应的描述。
 */

#include <stdio.h>

int main()
{
	int wind_speed;

	printf("Enter wind speed: ");
	scanf("%d", &wind_speed);

	if (wind_speed < 1)
		printf("Calm\n");
	else if (wind_speed >= 1 && wind_speed <= 3)
		printf("Light air\n");
	else if (wind_speed >= 4 && wind_speed <= 27)
		printf("Breeze\n");
	else if (wind_speed >= 28 && wind_speed <= 47)
		printf("Gale\n");
	else if (wind_speed >= 48 && wind_speed <= 63)
		printf("Storm\n");
	else if (wind_speed > 63)
		printf("Hurricane\n");

	return 0;
}


================================================
FILE: codes/CProgramming/ch05_选择语句/ex_09.c
================================================
/*
 * 在美国的某个州,未婚居民需要负担下列所得税:
 *
 *     收入                   税金
 *     未超过750美元          收入的1%
 *     750~2250美元           7.50美元加上超出750美元部分的2%
 *     2250~3750美元          37.50美元加上超出2250美元部分的3%
 *     3750~5250美元          82.50美元加上超出3750美元部分的4%
 *     5250~7000美元          142.50美元加上超出5250美元部分的5%
 *     超过7000美元           230.00美元加上超出7000美元部分的6%
 *
 *     编写一个程序,要求用户输入需纳税的收入,然后显示税金。
 */

#include <stdio.h>

#define PER 0.01

int main()
{
	float income, tax;

	printf("Enter income: ");
	scanf("%f", &income);

	if (income <= 750)
		tax = income * 1 * PER;
	else if (income > 750 && income <= 2250)
		tax = 7.50 + (income - 750) * 2 * PER;
	else if (income > 2250 && income <= 3750)
		tax = 37.50 + (income - 2250) * 3 * PER;
	else if (income > 3750 && income <= 5250)
		tax = 82.50 + (income - 3750) * 4 * PER;
	else if (income > 5250 && income <= 7000)
		tax = 142.50 + (income - 5250) * 5 * PER;
	else
		tax = 230.00 + (income - 7000) * 6 * PER;

	printf("tax: %.2f\n", tax);

	return 0;
}


================================================
FILE: codes/CProgramming/ch05_选择语句/ex_10.c
================================================
/*
 * 修改4.1节的程序 upc.c ,使其可以检测 UPC 的有效性。在用户输入 UPC 后,程序将显示 VALID 或 NOT
 * VALID 。
 */

/* 
 * Valid entry: 0 13800 15173 5
 */

#include <stdio.h>

int main()
{
	int d, i1, i2, i3, i4, i5, j1, j2, j3, j4, j5;
	int first_sum, second_sum, total, check_digit, enter_check_digit;

	printf("Enter the first (single) digit: ");
	scanf("%1d", &d);

	printf("Enter first group of five digits: ");
	scanf("%1d%1d%1d%1d%1d", &i1, &i2, &i3, &i4, &i5);

	printf("Enter second group of five digits: ");
	scanf("%1d%1d%1d%1d%1d", &j1, &j2, &j3, &j4, &j5);

	printf("Enter check digit: ");
	scanf("%1d", &enter_check_digit);

	first_sum = d + i2 + i4 + j1 + j3 + j5;
	second_sum = i1 + i3 + i5 + j2 + j4;

	total = 3 * first_sum + second_sum;

	check_digit = 9 - ((total - 1) % 10);

	if (check_digit == enter_check_digit)
		printf("VALID");
	else
		printf("NOTVALID");

	return 0;
}


================================================
FILE: codes/CProgramming/ch05_选择语句/ex_11.c
================================================
/*
 * 下列 if 语句在C语言中是否合法?
 *
 * if (n >= 1 <= 10)
 *     printf("n is between 1 and 10\n");
 *
 * 如果合法,那么当n等于0时语句如何执行?
 */

/*
 * 合法,n等于0时,会进入if内的语句。但这不是期望的。
 */

#include <stdio.h>

int main()
{
	int n;
	n = 0;

	if (n >= 1 <= 10)
		printf("n is between 1 and 10\n");

	return 0;
}


================================================
FILE: codes/CProgramming/ch05_选择语句/ex_12.c
================================================
/*
 * 下列 if 语句在C语言中是否合法?
 * if (n == 1 - 10)
 *     printf("n is between 1 and 10\n");
 *
 * 如果合法,那么当n等于5时语句如何执行?
 */

/*
 * 合法,n等于5时不会进入 if 语句。这样的写法也是错误的。
 */

#include <stdio.h>

int main()
{
	int n;
	n = 5;

	if (n == 1 - 10)
		printf("n is between 1 and 10\n");

	return 0;
}


================================================
FILE: codes/CProgramming/ch05_选择语句/ex_13.c
================================================
/*
 * 如果i的值为17,那么下列语句显示的结果是什么?如果i的值为-17,那么下列语句显示的结果又是
 * 什么?
 *
 * printf("%d\n", i >= 0 ? i : -i);
 */

/*
 * 都是17
 */

#include <stdio.h>

int main()
{
	int i;

	i = 17;
	printf("%d\n", i >= 0 ? i : -i);

	i = -17;
	printf("%d\n", i >= 0 ? i : -i);

	return 0;
}


================================================
FILE: codes/CProgramming/ch05_选择语句/ex_14.c
================================================
/*
 * 利用 switch 语句编写一个程序,把数字显示的成绩转化为字母显示的等级:
 *
 * Enter numerical grade: 84
 * Letter grade: B
 *
 * 使用下面这套等级评定规则:A=90~100,B=80~89,C=70~79,D=60~69,F=0~59。如果成绩
 * 高于100或低于0则显示出错信息。提示:把成绩拆分成2个数字,然后使用 switch 判定十位上的数字。
 *
 */

#include <stdio.h>

int main()
{
	int number_grade, g;
	char letter_grade;

	printf("Enter numerical grade: ");
	scanf("%d", &number_grade);

	if (number_grade < 0 || number_grade > 100) {
		printf("Invalid grade\n");
		return 1;
	}

	g = number_grade / 10;

	switch (g) {
		case 10:
		case 9:
			letter_grade = 'A'; break;

		case 8:
			letter_grade = 'B'; break;

		case 7:
			letter_grade = 'C'; break;

		case 6:
			letter_grade = 'D'; break;

		default:
			letter_grade = 'F'; break;
	}

	printf("Letter grade: %c\n", letter_grade);

	return 0;
}


================================================
FILE: codes/CProgramming/ch05_选择语句/ex_15.c
================================================
/*
 * 编写一个程序,要求用户输入一个两位的数,然后显示这个数的英文单词:
 *
 * Enter a two-digit number: 45
 * You entered the number forty-five
 *
 * 提示:把数分解为两个数字。用一个 switch 语句显示第一位数字对应的单词("twenty"、"thirty"
 * 等),用第二个 switch 语句显示第二位数字对应的单词。不要忘记11~19的数有特殊的处理要求。
 */

#include <stdio.h>

int main()
{
	int n1, n2; /* n1 十位,n2 个位 */

	printf("Enter a two-digit number: ");
	scanf("%1d%1d", &n1, &n2);

	printf("You entered the number ");

	switch (n1) {
		case 0:
		case 1:
			break;

		case 2:
			printf("twenty"); break;
		case 3:
			printf("thirty"); break;
		case 4:
			printf("forty"); break;
		case 5:
			printf("fifty"); break;
		case 6:
			printf("sixty"); break;
		case 7:
			printf("seventy"); break;
		case 8:
			printf("eighty"); break;
		case 9:
			printf("ninety"); break;
	}

	switch (n2) {
		case 0:
			if (n1 == 1) printf("ten"); break;
		case 1:
			if (n1 == 1) printf("eleven"); else printf("-one"); break;
		case 2:
			if (n1 == 1) printf("twelve"); else printf("-two"); break;
		case 3:
			if (n1 == 1) printf("thirteen"); else printf("-three"); break;
		case 4:
			if (n1 == 1) printf("fourteen"); else printf("-four"); break;
		case 5:
			if (n1 == 1) printf("fifteen"); else printf("-five"); break;
		case 6:
			if (n1 == 1) printf("sixteen"); else printf("-six"); break;
		case 7:
			if (n1 == 1) printf("seventeen"); else printf("-seven"); break;
		case 8:
			if (n1 == 1) printf("eighteen"); else printf("-eight"); break;
		case 9:
			if (n1 == 1) printf("nineteen"); else printf("-nine"); break;
	}

	printf("\n");

	return 0;
}


================================================
FILE: codes/CProgramming/ch05_选择语句/ex_16.c
================================================
/*
 * 请写出下面程序段的输出结果?(假设i是整型变量)
 */

/*
 * onetwo
 */

#include <stdio.h>

int main()
{
	int i;

	i = 1;
	switch (i % 3) {
		case 0: printf("zero");
		case 1: printf("one");
		case 2: printf("two");
	}

	putchar(10);

	return 0;
}


================================================
FILE: codes/CProgramming/ch06_循环/build.sh
================================================
#! /bin/bash

# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]

all_c_files=`ls *.c`
exclude_files=""

is_exclude_file() {
	for file in $exclude_files; do
		if [ "$file" = "$1" ]; then
			return 0
		fi
	done

	return 1
}

main() {
	for c_file in $all_c_files; do
		exe_file=${c_file%%.c*}

		if [ "$1" == "clear" ]; then
			rm -f $exe_file
			continue
		fi

		if is_exclude_file $c_file; then
			continue
		fi

		if [ $exe_file -nt $c_file ] && [ "$1" != "rebuild" ]; then
			continue
		fi

		echo "[BUILDING] $c_file -> $exe_file"
		gcc $c_file -o $exe_file

		if [ "$?" != "0" ]; then
			return 1
		fi
	done

	return 0
}

main $1

exit $?


================================================
FILE: codes/CProgramming/ch06_循环/checking.c
================================================
/* Balances a checkbook */

#include <stdio.h>

int main()
{
	int cmd;
	float balance = 0.0f, credit, debit;

	printf("*** Checkbook balance program ***\n");
	printf("Commands: 0=clear, 1=credit, 2=debit, 3=balance, 4=exit\n\n");

	while (1)
	{
		printf("Enter command: ");
		scanf("%d", &cmd);

		switch (cmd)
		{
			case 0:
				balance = 0.0f;
				break;
			case 1:
				printf("Enter amount of credit: ");
				scanf("%f", &credit);
				balance += credit;
				break;
			case 2:
				printf("Enter amount of debit: ");
				scanf("%f", &debit);
				balance -= debit;
				break;
			case 3:
				printf("Current balance: %.2f\n", balance);
				break;
			case 4:
				return 0;
			default:
				printf("Commands: 0=clear, 1=credit, 2=debit, 3=balance, 4=exit\n\n");
				break;
		}
	}
}


================================================
FILE: codes/CProgramming/ch06_循环/ex_01.c
================================================
/*
 * 编写程序,要求找到用户输入的一串数中的最大数。程序需要提示用户一个一个输入数。当用户输入
 * 0或负数时,程序必须显示输入的最大非负数:
 *
 * Enter a number: 60
 * Enter a number: 100.62
 * Enter a number: 0
 *
 * The largest number entered was 100.62
 *
 * 注意,输入的数不要求一定是整数。
 */

#include <stdio.h>

int main()
{
	float n, largest;

	largest = 0;
	do {
		printf("Enter a number: ");
		scanf("%f", &n);

		if (largest < n) largest = n;
		
	} while (n > 0);

	printf("The largest number entered was %g\n", largest);

	return 0;
}


================================================
FILE: codes/CProgramming/ch06_循环/ex_02.c
================================================
/*
 * 编写程序,要求用户输入两个整数,然后计算并显示这两个整数的最大公约数(GCD):
 * 
 * Enter two integers: 12 28
 * Greatest common divisor: 4
 *
 * 提示:求最大公约数的经典算法是 Euclid 算法,方法如下:分别让变量m和n存储两个数的值;用m除
 * 以n;把除数保存在m中,而把余数保存在n中;如果n为0,那么停止操作,m中的值是GCD;否则,
 * 从m除以n开始,重复上述除法过程。
 */

#include <stdio.h>

int main()
{
	int m, n, tmp;

	printf("Enter two integers: ");
	scanf("%d%d", &m, &n);

	while (n != 0) {
		tmp = m;
		m = n;
		n = tmp % n;
	}

	printf("Greatest common divisor: %d\n", m);

	return 0;
}


================================================
FILE: codes/CProgramming/ch06_循环/ex_03.c
================================================
/*
 * 编写程序,要求用户输入一个分数,然后将其约分为最简分式:
 *
 * Enter a fraction: 6/12
 * In lowest terms: 1/2
 *
 * 提示:为了把分数约分为最简分式,首先计算分子和分母的最大公约数;然后分子和分母分别都除以
 * 最大公约数。
 */ 

#include <stdio.h>

int main()
{
	int m, n, tmp, gcd, divisor;

	printf("Enter a fraction: ");
	scanf("%d/%d", &m, &n);

	gcd = m;
	divisor = n;
	while (divisor != 0) {
		tmp = gcd;
		gcd = divisor;
		divisor = tmp % divisor;
	}

	printf("In lowest terms: %d/%d\n", m/gcd, n/gcd);

	return 0;
}


================================================
FILE: codes/CProgramming/ch06_循环/ex_04.c
================================================
/*
 * 在5.2节的 broker.c 程序中添加循环以使用户可以输入多比交易,并且程序可以计算每次的佣金。程
 * 序在用户输入的交易额为0时终止。
 *
 * Enter value of trade: 30000
 * Commision: $166.00
 * Enter value of trade: 20000
 * Commision: $144.00
 * Enter value of trade: 0
 */

#include <stdio.h>

int main()
{
	float value, commision;

	printf("Enter value of trade: ");
	scanf("%f", &value);

	while (value != 0) {
		if (value < 2500)
			commision = 30.0f + 0.01 * 0.17 * value;
		else if (value < 6250)
			commision = 56.0f + 0.01 * 0.66 * value;
		else if (value < 20000)
			commision = 76.0f + 0.01 * 0.34 * value;
		else if (value < 50000)
			commision = 100 + 0.01 * 0.22 * value;
		else if (value < 500000)
			commision = 155 + 0.01 * 0.11 * value;
		else
			commision = 255 + 0.01 * 0.09 * value;

		if (commision < 39)
			commision = 39;

		printf("The commision is: $%.2f\n", commision);

		printf("Enter value of trade: ");
		scanf("%f", &value);
	}

	return 0;
}


================================================
FILE: codes/CProgramming/ch06_循环/ex_05.c
================================================
/*
 * 第4章中的练习3要求编写程序可以显示两位数字的反向。设计一个程序可以实现一位、两位、三位或者多位数的反向。提示:使用 do 循环重复除以10,直到值达到0为止。
 */

#include <stdio.h>

int main()
{
	int n, tmp;

	printf("Enter a number: ");
	scanf("%d", &n);

	do {
		tmp = n - n / 10 * 10;
		n /= 10;

		printf("%d", tmp);

	} while (n);

	return 0;
}


================================================
FILE: codes/CProgramming/ch06_循环/ex_06.c
================================================
/*
 * 编写程序,要求提示用户输入一个数n,然后显示出1~n的所有偶数平方。例如,如果用户输入10,
 * 那么程序员应该显示出下列内容:
 *
 * 4
 * 16
 * 36
 * 64
 * 100
 */

#include <stdio.h>

int main()
{
	int n, i;

	printf("Enter a number: ");
	scanf("%d", &n);

	for (i = 2; i <= n; i += 2) {
		printf("%d\n", i * i);
	}

	return 0;
}


================================================
FILE: codes/CProgramming/ch06_循环/ex_07.c
================================================
/*
 * 重新安排程序 square3.c 以便 for 循环对变量i进行初始化,对变量i进行判定,并且对变量i进行
 * 自增操作。不需要重写程序,特别是不要使用任何乘法。
 */

#include <stdio.h>

int main()
{
	int i, n, odd, square;

	printf("This program prints a table of squares.\n");
	printf("Enter number of entries in table: ");
	scanf("%d", &n);

	odd = 3;
	for (i = 1, square = 1; i <= n; odd += 2, ++i) {
		printf("%10d%10d\n", i, square);
		square += odd;
	}

	return 0;
}


================================================
FILE: codes/CProgramming/ch06_循环/ex_08.c
================================================
/*
 * 编写程序,要求显示出单月的日历。用户说明这个月的天数和本月起始日是星期几。
 *
 * Enter number of days in month: 31
 * Enter starting day of the week(1=Sun, 7=Sat): 3
 *
 *         1   2   3   4   5
 * 6   7   8   9   10  11  12
 * 13  14  15  16  17  18  19
 * 20  21  22  23  24  25  26
 * 27  28  29  30  31
 *
 * 提示:此程序不像看上去那么难。最重要的内容是 for 语句使用变量i从1计数到n,n是此月的天数,
 * 显示出i的每个值。在循环中,用 if 语句判定i是否是一个星期的最后一天,如果是,就显示一个换
 * 行符。
 */

#include <stdio.h>

int main()
{
	int days, starting_day, i, j;

	printf("Enter number of days in month: ");
	scanf("%d", &days);

	printf("Enter starting day of the week(1=Sun, 7=Sat): ");
	scanf("%d", &starting_day);

	printf("Sun\tMon\tTues\tWed\tThur\tFri\tSat\n");
	
	for (i = 1; i < starting_day; ++i)
		printf("\t");


	for (j = 1; j <= days; ++j, ++i) {
		printf("%d\t", j);

		if (i >= 7) {
			printf("\n");
			i = 0;
		}
	}

	printf("\n");

	return 0;
}


================================================
FILE: codes/CProgramming/ch06_循环/ex_09.c
================================================
/*
 * 下面这条 for 语句的输出是什么?
 *
 * for (i = 5, j = i - 1; i > 0, j > 0; --i, j = i - 1)
 * 	printf("%d ", i);
 */

/*
 * r1: i = 5, j = 4 -> 5
 * r2: i = 4, j = 3 -> 4
 * r3: i = 3, j = 2 -> 3
 * r4: i = 2, j = 1 -> 2
 * r5: i = 1, j = 0
 *
 * result: 5 4 3 2
 */

#include <stdio.h>

int main()
{
	int i, j;
	for (i = 5, j = i - 1; i > 0, j > 0; --i, j = i - 1)
		printf("%d ", i);

	return 0;
}


================================================
FILE: codes/CProgramming/ch06_循环/ex_10.md
================================================
下列哪条语句和其他两条语句不等价(假设循环体都是一样的)?

(a) for (i = 0; i < 10; i++) ...

(b) for (i = 0; i < 10; ++i) ...

(c) for (i = 0; i++ < 10; ) ...

---

c与a、b不等价。

a、b都是等循环体执行完毕后,对i做自增操作。而c是在循环体进入前就已经自增了。


================================================
FILE: codes/CProgramming/ch06_循环/ex_11.md
================================================
下列哪条语句和其他两条语句不等价(假设循环体都是一样的)?

(a) while (i < 10) {...}

(b) for (; i < 10;) {...}

(c) do {...} while (i < 10);

---

c与a、b不等价,因为c会首先执行一次循环体,然后再判断条件表达式。a和b是先判断条件表达式,然后才会执行循环体。


================================================
FILE: codes/CProgramming/ch06_循环/ex_12.c
================================================
/*
 * 显示如何用等价的 goto 语句替换 continue 语句。
 */

#include <stdio.h>

int main()
{
	/* 输出10以内的奇数 */
	int i;

	for (i = 0; i < 10; ++i) {
		if (i % 2 == 0) goto end_of_loop;

		printf("%d ", i);

		end_of_loop:;
	}

	return 0;
}


================================================
FILE: codes/CProgramming/ch06_循环/ex_13.c
================================================
/*
 * 下面的程序段产生的输出是什么?
 *
 * sum = 0;
 * for (i = 0; i < 10; ++i) {
 * 	if (i % 2) continue;
 * 	sum += i;
 * }
 * printf("%d\n", sum);
 */

/*
 * 将10以内的所有偶数加起来的结果,2 + 4 + 6 + 8 = 20
 */

#include <stdio.h>

int main()
{
	int i, sum;

	sum = 0;
	for (i = 0; i < 10; ++i) {
		if (i % 2) continue;
		sum += i;
	}
	printf("%d\n", sum);

	return 0;
}


================================================
FILE: codes/CProgramming/ch06_循环/ex_14.c
================================================
/*
 * 下面的“素数判定”循环作为示例出现在6.4节中:
 *
 * for (d = 2; d < n; d++)
 * 	if (n % d == 0) break;
 *
 * 这个循环不是很有效。用n除以2~n-1所有数的方法来判断它是否为素数是没有必要的。事实上,只
 * 需要检查不大于n的平方根的除数。利用这一点来修改循环。提示:不要试图计算出n的平方根,而
 * 是用d*d和n进行比较。
 */

#include <stdio.h>

int main()
{
	int n;
	int d;

	printf("Enter a number: ");
	scanf("%d", &n);

	for (d = 2; d * d < n; ++d)
		if (n % d == 0) goto done;

done:
	if (d * d < n)
		printf("%d is divisible by %d\n", n, d);
	else
		printf("%d is prime\n", n);

	return 0;
}


================================================
FILE: codes/CProgramming/ch06_循环/ex_15.c
================================================
/*
 * 重写下面的循环,从而使其循环体为空。
 *
 * for (n = 0; m > 0; n++)
 * 	m /= 2;
 */

#include <stdio.h>

int main()
{
	int n, m;

	m = 8;
	for (n = 0; m > 0; m /= 2, n++);

	return 0;
}


================================================
FILE: codes/CProgramming/ch06_循环/ex_16.md
================================================
找出下面程序段的错误并且修正它。

```c
if (n % 2 == 0);
	printf("n is even\n");
```

---

if 的条件判断后不应该是一个分号。正确的应该是:

```c
if (n % 2 == 0)
	printf("%d is even\n", n);
```


================================================
FILE: codes/CProgramming/ch06_循环/example_goto.c
================================================
/*
 * goto 语句(p71)
 */

#include <stdio.h>

/* 输入一个值,判断它是否是质数 */
int main()
{
	int n;
	int d;

	printf("Enter a number: ");
	scanf("%d", &n);

	for (d = 2; d < n; ++d)
		if (n % d == 0) goto done;

done:
	if (d < n)
		printf("%d is divisible by %d\n", n, d);
	else
		printf("%d is prime\n", n);

	return 0;
}


================================================
FILE: codes/CProgramming/ch06_循环/numdigit.c
================================================
/* Calculates the number of digits in an integer */

#include <stdio.h>

int main()
{
	int digits = 0, n;

	printf("Enter a nonnegative integer: ");
	scanf("%d", &n);

	do
	{
		n /= 10;
		++digits;
	} while (n > 0);

	printf("The number has %d digit(s).\n", digits);

	return 0;
}


================================================
FILE: codes/CProgramming/ch06_循环/square.c
================================================
/* Prints a table of squares using a while statement */

#include <stdio.h>

int main(void)
{
	int i, n;

	printf("This program prints a table of squares.\n");
	printf("Enter number of entries in table: ");
	scanf("%d", &n);

	i = 1;
	while (i <= n)
	{
		printf("%10d%10d\n", i, i * i);

		++i;
	}

	return 0;
}


================================================
FILE: codes/CProgramming/ch06_循环/square2.c
================================================
/* Prints a table of squares using a for statement */

#include <stdio.h>

int main()
{
	int i, n;

	printf("This program prints a table of squares.\n");
	printf("Enter number of entries in table: ");
	scanf("%d", &n);

	for (i = 1; i <= n; ++i)
		printf("%10d%10d\n", i, i * i);

	return 0;
}


================================================
FILE: codes/CProgramming/ch06_循环/square3.c
================================================
/* Prints a table of squares using an odd method */

#include <stdio.h>

int main()
{
	int i, n, odd, square;

	printf("This program prints a table of squares.\n");
	printf("Enter number of entries in table: ");
	scanf("%d", &n);

	i = 1;
	odd = 3;
	for (square = 1; i <= n; odd += 2) {
		printf("%10d%10d\n", i, square);
		++i;
		square += odd;
	}

	return 0;
}


================================================
FILE: codes/CProgramming/ch06_循环/sum.c
================================================
/* Sums a serias of numbers */

#include <stdio.h>

int main()
{
	int n, sum = 0;

	printf("This program sums a serias of integers.\n");
	printf("Enter integers(0 to terminate): ");

	scanf("%d", &n);
	while (n != 0)
	{
		sum += n;
		scanf("%d", &n);
	}

	printf("The sum is: %d\n", sum);

	return 0;
}


================================================
FILE: codes/CProgramming/ch07_基本类型/build.sh
================================================
#! /bin/bash

# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]

all_c_files=`ls *.c`
exclude_files=""

is_exclude_file() {
	for file in $exclude_files; do
		if [ "$file" = "$1" ]; then
			return 0
		fi
	done

	return 1
}

main() {
	for c_file in $all_c_files; do
		exe_file=${c_file%%.c*}

		if [ "$1" == "clear" ]; then
			rm -f $exe_file
			continue
		fi

		if is_exclude_file $c_file; then
			continue
		fi

		if [ $exe_file -nt $c_file ] && [ "$1" != "rebuild" ]; then
			continue
		fi

		echo "[BUILDING] $c_file -> $exe_file"
		gcc $c_file -o $exe_file

		if [ "$?" != "0" ]; then
			return 1
		fi
	done

	return 0
}

main $1

exit $?


================================================
FILE: codes/CProgramming/ch07_基本类型/ex_01.c
================================================
/*
 * 请给出下列整型常量的十进制数值。
 *
 * (a) 077
 * (b) 0x77
 * (c) 0XABC
 */

#include <stdio.h>

int main()
{
	printf("%d\n", 077); /* 63 */
	printf("%d\n", 0x77); /* 119 */
	printf("%d\n", 0XABC); /* 2748 */

	return 0;
}


================================================
FILE: codes/CProgramming/ch07_基本类型/ex_02.c
================================================
/*
 * 如果i*i超出了 int 型的最大取值,那么6.3节的程序 square2.c 将失败(通常会显示奇怪的答案)。
 * 运行程序,并且确定导致失败的n的最小值。尝试把变量i的类型改成 short int 类型,并且再次
 * 运行程序。(不要忘记更新 printf 函数调用中的转换说明!)然后尝试改换成 long int 类型。从这
 * 些实验中,你能总结出在你的机器上用于存储整型的位数的多少吗?
 */

/*
 * int 32位
 * short int 16位
 * long int 64位
 *
 * PS: 不太好用实验的方法总结出来,最好的方式是直接用 sizeof 运算符确定
 */

#include <stdio.h>

int main()
{
	int i, n;
	long int check;

	printf("This program prints a table of squares.\n");
	printf("Enter number of entries in table: ");
	scanf("%d", &n);

	for (i = 1; i <= n; ++i) {
		check = i;
		if (i * i != check * check) {
			printf("hit invalid i: %d\n", i);
			break;
		}

		printf("%10d%10d\n", i, i * i);
	}

	printf("bit count of int: %lu\n", sizeof(int) * 8);
	printf("bit count of short int: %lu\n", sizeof(short int) * 8);
	printf("bit count of long int: %lu\n", sizeof(long int) * 8);

	return 0;
}


================================================
FILE: codes/CProgramming/ch07_基本类型/ex_03.c
================================================
/*
 * 下列哪些在C语言中不是合法的数?区分每一个合法的数是整数还是浮点数。
 *
 * (a) 010E2
 * (b) 32.1E+5
 * (c) 0790
 * (d) 100_000
 * (e) 3.978e-2
 */

#include <stdio.h>

int main()
{
	int i;
	double d;

	d = 010E2; /* 浮点数 */

	d = 32.1E+5; /* 浮点数 */

	/* i = 0790;  错误的八进制数,因9不存在于八进制中 */

	/* i = 100_000; 错误的书写方式 */

	d = 3.978e-2; /* 浮点数 */

	/* ignore no-use warning */
	(void)i;
	(void)d;

	return 0;
}


================================================
FILE: codes/CProgramming/ch07_基本类型/ex_04.c
================================================
/*
 * 下列哪些在C语言中不是合法的类型?
 *
 * (a) short unsigned int
 * (b) short float
 * (c) long double
 * (d) unsigned long
 */

int main()
{
	short unsigned int sui; (void)sui;

	/* short float sf;  不合法的 */

	long double ld; (void)ld;

	unsigned long ul; (void)ul;

	return 0;
}


================================================
FILE: codes/CProgramming/ch07_基本类型/ex_05.c
================================================
/*
 * 修改程序 sum2.c 以便可以进行一串 double 型值的求和计算。
 */

#include <stdio.h>

int main()
{
	double n, sum = 0;

	printf("This program sums a series of numbers.\n");
	printf("Enter numbers (0 to terminate): ");

	scanf("%lf", &n);
	while (n != 0) {
		sum += n;
		scanf("%lf", &n);
	}
	printf("The sum is: %f\n", sum);

	return 0;
}


================================================
FILE: codes/CProgramming/ch07_基本类型/ex_06.c
================================================
/*
 * 如果变量c是char类型,那么下列哪条语句是非法的?
 *
 * (a) i += c;
 * (b) c = 2 * c - 1;
 * (c) putchar(c);
 * (d) printf(c);
 */

#include <stdio.h>

int main()
{
	char c;
	int i;
	i = 0;
	c = 0;

	i += c;
	c = 2 * c - 1;
	putchar(c);
	/* printf(c); */

	return 0;
}


================================================
FILE: codes/CProgramming/ch07_基本类型/ex_07.md
================================================
下列哪条在书写数65上不是合法的方式?(假设字符集是ASCII)

(a) 'A'

(b) 0b1000001

(c) 0101

(d) 0x41

---

(b) 不是


================================================
FILE: codes/CProgramming/ch07_基本类型/ex_08.c
================================================
/*
 * 修改6.3节的程序 square2.c 以便它在每24次平方后暂停并且显示下列信息:
 * Press Enter to continue...
 */

/* Prints a table of squares using a for statement */

#include <stdio.h>

int main()
{
	int i, n;
	int ch;

	printf("This program prints a table of squares.\n");
	printf("Enter number of entries in table: ");
	scanf("%d", &n);
	getchar(); /* skip enter character */

	for (i = 1; i <= n; ++i) {
		printf("%10d%10d\n", i, i * i);

		if (i % 24 == 0) {
			do {
				printf("Press Enter to continue...");
				ch = getchar();
			} while (ch != 10) ;
		}
	}

	return 0;
}


================================================
FILE: codes/CProgramming/ch07_基本类型/ex_09.c
================================================
/*
 * 编写程序可以把字母格式的电话号码翻译成数值格式:
 *
 * Enter phone number: CALLATT
 * 2255288
 *
 * (万一没有电话在身边,后面有字母在键盘上的对应关系:2=ABC, 3=DEF, 4=GHI, 5=JKL, 6=MNO,
 * 7=PRS, 8=TUV, 9=WXY。)如果原始的电话号码包含非字母的字符(例如,数字或标点符号),那
 * 么保留下来不做变化:
 *
 * Enter phone number: 1-900-COL-LECT
 * 1-800-265-5328
 */

#include <stdio.h>

int main()
{
	int n;

	printf("Enter phone number: ");

	while ((n = getchar()) != '\n') {
		if (!isalpha(n)) {
			putchar(n);
			continue;
		}

		n = toupper(n);
		if (n == 'A' || n == 'B' || n == 'C') putchar('2');
		else if (n == 'D' || n == 'E' || n == 'F') putchar('3');
		else if (n == 'G' || n == 'H' || n == 'I') putchar('4');
		else if (n == 'J' || n == 'K' || n == 'L') putchar('5');
		else if (n == 'M' || n == 'N' || n == 'O') putchar('6');
		else if (n == 'P' || n == 'R' || n == 'S') putchar('7');
		else if (n == 'T' || n == 'U' || n == 'V') putchar('8');
		else if (n == 'W' || n == 'X' || n == 'Y') putchar('9');
	}

	putchar(10);

	return 0;
}


================================================
FILE: codes/CProgramming/ch07_基本类型/ex_10.c
================================================
/*
 * 在十字拼字游戏中,玩家利用小卡片组成单词,每个卡片包含字母和面值。面值根据字母的不同而
 * 不同,也就是说面值是基于字母变化的。(面值有:1-AEILNORSTU, 2-DG, 3-BCMP, 4-FHVWY, 5-K
 * , 8-JX, 10-QZ。)编写程序通过对字母对应的面值求和来计算单词的值:
 *
 * Enter a word: pitfall
 * Scrabble value: 12
 *
 * 编写的程序应该允许单词中混合出现大小写字母。提示:使用 toupper 库函数。
 */

#include <stdio.h>

int main()
{
	int ch;
	int value;

	printf("Enter a word: ");

	value = 0;
	while ((ch = getchar()) != '\n') {
		ch = toupper(ch);

		switch (ch) {
			case 'A':
			case 'E':
			case 'I':
			case 'L':
			case 'N':
			case 'O':
			case 'R':
			case 'S':
			case 'T':
			case 'U':
				value += 1;
				break;

			case 'D':
			case 'G':
				value += 2;
				break;

			case 'B':
			case 'C':
			case 'M':
			case 'P':
				value += 3;
				break;

			case 'F':
			case 'H':
			case 'V':
			case 'W':
			case 'Y':
				value += 4;
				break;

			case 'K':
				value += 5;
				break;

			case 'J':
			case 'X':
				value += 8;
				break;

			case 'Q':
			case 'Z':
				value += 10;
				break;
		}
	}

	printf("Scrabble value: %d\n", value);

	return 0;
}


================================================
FILE: codes/CProgramming/ch07_基本类型/ex_11.c
================================================
/*
 * 飞机票有冗长的标识数字,例如47715497443。为了有效,最后一位数字必须与其他位的数字为整体
 * 除以7后的余数相匹配。(例如,47715497443除以7的余数为3。)编写程序检查机票号是否有效:
 *
 * Enter ticket number: 47715497443
 * VALID
 *
 * 提示:不要试图在单步操作中读取数,而是使用 getchar 函数逐个获取数字。一次执行一个数字的除法,
 * 小心除法中不要包含最后一位数字。
 */

/*
 * PS: 提示的意思是,为了防止整型数值溢出。
 */

#include <stdio.h>

int main()
{
	int ch;
	int digit;			/* 当前处理的数字 0~9 */
	int check_number;	/* 当前判断的数字,超过了7则使用一次取余运算 */
	int tmp;

	printf("Enter ticket number: ");
	
	while ((ch = getchar()) != '\n') {
		digit = ch - '0';

		tmp = check_number * 10 + digit;
		check_number = tmp >= 7 ? tmp % 7 : tmp;
	}

	check_number = (tmp - digit) / 10;
	if (check_number == digit)
		printf("VALID\n");
	else
		printf("INVALID\n");

	return 0;
}


================================================
FILE: codes/CProgramming/ch07_基本类型/ex_12.c
================================================
/*
 * 编写程序显示 sizeof(int) 、 sizeof(short int) 、 sizeof(long int) 、 sizeof(float) 、
 * sizeof(double) 和 sizeof(long double) 的值。
 */

#include <stdio.h>

int main()
{
	printf("sizeof(int): %lu\n", sizeof(int));
	printf("sizeof(short): %lu\n", sizeof(short));
	printf("sizeof(long int): %lu\n", sizeof(long int));
	printf("sizeof(float): %lu\n", sizeof(float));
	printf("sizeof(double): %lu\n", sizeof(double));
	printf("sizeof(long double): %lu\n", sizeof(long double));

	return 0;
}


================================================
FILE: codes/CProgramming/ch07_基本类型/ex_13.md
================================================
假设变量i和变量j都是 int 类型,那么表达式 i / j + 'a' 是什么类型?

---

是 int 类型。


================================================
FILE: codes/CProgramming/ch07_基本类型/ex_15.md
================================================
假设变量i是 int 类型,变量f是 float 类型,并且变量d是 double 类型,那么表达式 `i * f / d` 是什么类型?

---

double


================================================
FILE: codes/CProgramming/ch07_基本类型/ex_16.md
================================================
假设变量i是 int 类型,变量f是 float 类型,并且变量d是 double 类型,请解释在执行下列语句时发生了什么转换?

```c
d = i + f;
```

---

i + f,将 int 转换成 float,然后将这个表达式的结果从 float 转换成 double 。


================================================
FILE: codes/CProgramming/ch07_基本类型/ex_17.c
================================================
/*
 * 假设程序包含下列声明:
 *
 * char c = '\1';
 * short int s = 2;
 * int i = -3;
 * long int m = 5;
 * float f = 6.5;
 * double d = 7.5;
 *
 * 请给出下列每个表达式的值和类型。
 *
 * (a) c * i
 * (b) s + m
 * (c) f / c
 * (d) d / s
 * (e) f - d
 * (f) (int)f
 */

#include <stdio.h>

int main()
{
	char c = '\1';
	short int s = 2;
	int i = -3;
	long int m = 5;
	float f = 6.5;
	double d = 7.5;

	printf("%d\n", c * i);	/* int, -3				*/
	printf("%ld\n", s + m);	/* long int, 7 			*/
	printf("%f\n", f / c);	/* float, 6.5			*/
	printf("%f\n", d / s);	/* double, 3.75			*/
	printf("%f\n", f - d);	/* double, -1.0			*/
	printf("%d\n", (int)f);	/* int, 6				*/

	return 0;
}


================================================
FILE: codes/CProgramming/ch07_基本类型/ex_18.md
================================================
下列语句是否始终可以正确地计算出f的小数部分(假设f和 frac_part 都是 float 型的变量)?

```c
frac_part = f - (int)f;
```

如果不是,那么出了什么问题?

---

可能不会正确计算,当f超出了 int 的取值范围。


================================================
FILE: codes/CProgramming/ch07_基本类型/ex_19.c
================================================
/*
 * 使用 typedef 产生名为 Int8 、 Int16 和 Int32 的类型。定义这些类型以便它们可以在你的机器上分
 * 别表示8位、16位和32位的整数。
 */

/*
 * PS,我的机器架构是:x86_64
 */

#include <stdio.h>

typedef char Int8;
typedef short Int16;
typedef int Int32;

int main()
{
	printf("bits of Int8: %lu\n", 8 * sizeof(Int8));
	printf("bits of Int16: %lu\n", 8 * sizeof(Int16));
	printf("bits of Int32: %lu\n", 8 * sizeof(Int32));

	return 0;
}


================================================
FILE: codes/CProgramming/ch07_基本类型/length.c
================================================
/* Determins the length of a message */

#include <stdio.h>

// 把输入行的剩余字符读完,返回读入的字符数,不包括\n
int skips_rest_line()
{
	int length = 0;
	while (getchar() != '\n')
	{
		++ length;
	}

	return length;
}

int main()
{
	printf("Enter a message: ");
	int length = skips_rest_line();

	printf("Your message was %d character(s) long.\n", length);

	return 0;
}


================================================
FILE: codes/CProgramming/ch07_基本类型/mytoupper.c
================================================
/* 字符小写转大写 */

#include <stdio.h>

char my_toupper(char c)
{
	if (c >= 'a' && c <= 'z')
	{
		c = c - 'a' + 'A';
	}

	return c;
}

int main()
{
	char c;

	c = 'h';
	c = my_toupper(c);

	printf("c = %c\n", c);

	return 0;
}


================================================
FILE: codes/CProgramming/ch07_基本类型/scanf_char.c
================================================
/* 测试读入字符,且不要读入前面的空格 */

#include <stdio.h>

int main()
{
	char a, b;

	scanf("%c %c", &a, &b); // a和b之间可以输入任意个空格
	// scanf("%c%c", &a, &b); // 这样是不行的,b可以读取空格

	printf("%c, %c\n", a, b);

	return 0;
}


================================================
FILE: codes/CProgramming/ch07_基本类型/sum2.c
================================================
/*
 * 数列求和(改进版)(p81)
 */

/* Sums a series of numbers (using long int variabels) */

#include <stdio.h>

int main()
{
	long int n, sum = 0;

	printf("This program sums a series of integers.\n");
	printf("Enter integers (0 to terminate): ");

	scanf("%ld", &n);
	while (n != 0) {
		sum += n;
		scanf("%ld", &n);
	}
	printf("The sum is: %ld\n", sum);

	return 0;
}


================================================
FILE: codes/CProgramming/ch07_基本类型/typedef_sizeof.c
================================================
/* 测试typedef和sizeof */

#include <stdio.h>

typedef char Name[32];

int main()
{
	Name name;

	printf("sizeof name: %lu\n", sizeof(name));

	return 0;
}


================================================
FILE: codes/CProgramming/ch08_数组/build.sh
================================================
#! /bin/bash

# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]

all_c_files=`ls *.c`
exclude_files=""

is_exclude_file() {
	for file in $exclude_files; do
		if [ "$file" = "$1" ]; then
			return 0
		fi
	done

	return 1
}

main() {
	for c_file in $all_c_files; do
		exe_file=${c_file%%.c*}

		if [ "$1" == "clear" ]; then
			rm -f $exe_file
			continue
		fi

		if is_exclude_file $c_file; then
			continue
		fi

		if [ $exe_file -nt $c_file ] && [ "$1" != "rebuild" ]; then
			continue
		fi

		echo "[BUILDING] $c_file -> $exe_file"
		gcc -g -Wall $c_file -o $exe_file

		if [ "$?" != "0" ]; then
			return 1
		fi
	done

	return 0
}

main $1

exit $?


================================================
FILE: codes/CProgramming/ch08_数组/deal.c
================================================
/* Deals a random hand of cards. */

#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <string.h>

#define NUM_SUITS 4
#define NUM_RANKS 13

int main()
{
	int inhand_cards[NUM_SUITS][NUM_RANKS];
	char suit_list[NUM_SUITS] = {'c', 'd', 'h', 's'};
	char rank_list[NUM_RANKS] = {'A', '2', '3', '4', '5', '6', '7', '8', '9', 't', 'J', 'Q', 'K'};
	int need_cards;
	int rank, suit;

	printf("Enter number of cards in hand: ");
	scanf("%d", &need_cards);

	printf("Your hand:");

	memset(inhand_cards, 0, sizeof(inhand_cards));

	srand((unsigned int)time(NULL));
	while (need_cards > 0)
	{
		suit = rand() % NUM_SUITS;
		rank = rand() % NUM_RANKS;
		if (inhand_cards[suit][rank] == 0)
		{
			inhand_cards[suit][rank] = 1;
			-- need_cards;

			printf(" %c%c", suit_list[suit], rank_list[rank]);
		}
	}
	printf("\n");

	return 0;
}


================================================
FILE: codes/CProgramming/ch08_数组/ex_01.c
================================================
/*
 * 修改程序 repdigit.c ,要求修改后的程序可以显示出重复的数字(如果有的话):
 *
 * Enter a number: 939577
 * Repeated digit(s): 7 9
 */

/*
 * 程序:检查数中重复出现的数字(p101)
 *
 * Enter a number: 28212
 * Repeated digit
 */

/* Checks numbers for repeated digits */

#include <stdio.h>

typedef int Bool;

int main()
{
	int digit_seen_times[10] = {0};
	int digit;
	long int n;
	int i;

	printf("Enter a number: ");
	scanf("%ld", &n);

	while (n > 0) {
		digit = n % 10;
		++digit_seen_times[digit];
		n /= 10;
	}

	printf("Repeated digit(s):");
	for (i = 0; i < 10; i++) {
		if (digit_seen_times[i] > 1)
			printf(" %d", i);
	}
	printf("\n");

	return 0;
}


================================================
FILE: codes/CProgramming/ch08_数组/ex_02.c
================================================
/*
 * 修改程序 repdigit.c ,要求修改后的程序可以显示出一张列表,表内显示出每种数字在数中出现的
 * 次数:
 *
 * Enter a number: 41271092
 * Digit:		0 1 2 3 4 5 6 7 8 9
 * Occurrences: 1 2 2 0 1 0 0 1 0 1
 */

/*
 * 程序:检查数中重复出现的数字(p101)
 *
 * Enter a number: 28212
 * Repeated digit
 */

/* Checks numbers for repeated digits */

#include <stdio.h>

typedef int Bool;

int main()
{
	int digit_seen_times[10] = {0};
	int digit;
	long int n;
	int i;

	printf("Enter a number: ");
	scanf("%ld", &n);

	while (n > 0) {
		digit = n % 10;
		++digit_seen_times[digit];
		n /= 10;
	}

	printf("Digit:\t\t");
	for (i = 0; i < 10; i++)
		printf(" %d", i);
	printf("\n");

	printf("Occurrences:\t");
	for (i = 0; i < 10; i++) {
		printf(" %d", digit_seen_times[i]);
	}
	printf("\n");

	return 0;
}


================================================
FILE: codes/CProgramming/ch08_数组/ex_03.c
================================================
/*
 * 修改程序 repdigit.c,要求修改后的程序可以让用户录入多于一个的数进行重复数字的判断。当用
 * 户录入的数小于或等于0时,程序终止。
 */

/*
 * 程序:检查数中重复出现的数字(p101)
 *
 * Enter a number: 28212
 * Repeated digit
 */

/* Checks numbers for repeated digits */

#include <stdio.h>

#define TRUE 1
#define FALSE 0

typedef int Bool;

int main()
{
	Bool digit_seen[10] = {0};
	int digit;
	int i;
	long int n, tmp_n;

	printf("Enter a number: ");
	scanf("%ld", &n);
	tmp_n = n;
	
	while (tmp_n > 0) {
		
		for (i = 0; i < 10; i++)
			digit_seen[i] = FALSE;

		while (n > 0) {
			digit = n % 10;
			if (digit_seen[digit])
				break;
			digit_seen[digit] = TRUE;
			n /= 10;
		}

		if (n > 0)
			printf("Repeated digit\n\n");
		else
			printf("No repeated digit\n\n");

		printf("Enter a number: ");
		scanf("%ld", &n);
		tmp_n = n;
	}

	return 0;
}


================================================
FILE: codes/CProgramming/ch08_数组/ex_04.md
================================================
已经讨论过利用表达式`sizeof(a) / sizeof(a[0])`进行数组元素个数的计算。表达式`sizeof(a)/sizeof(t)`也可以完成同样的工作,其中t表示数组a中元素的类型,但是这种方法被认为是一种较差的技术。这是为什么呢?

---

可能是因为这样就定义了一个不是很通用的宏。


================================================
FILE: codes/CProgramming/ch08_数组/ex_05.c
================================================
/*
 * 修改程序 reverse.c ,利用表达式 sizeof(a) / sizeof(a[0]) (或者这个值的宏)来计算数组
 * 的长度。
 */

/*
 * 程序:数列反向(p100)
 *
 * Enter 10 numbers: 34 82 49 102 7 94 23 11 50 31
 * In reverse order: 31 50 11 23 94 7 102 49 82 34
 */

/* Reverses a series of numbers */

#include <stdio.h>

#define N 10
#define ARR_LEN (sizeof(a) / sizeof(a[0]))

int main()
{
	int a[N], i;

	printf("Enter %lu numbers: ", ARR_LEN);
	for (i = 0; i < ARR_LEN; ++i)
		scanf("%d", &a[i]);

	printf("In reverse order:");
	for (i = ARR_LEN - 1; i >= 0; i--)
		printf(" %d", a[i]);
	printf("\n");

	return 0;
}


================================================
FILE: codes/CProgramming/ch08_数组/ex_06.c
================================================
/*
 * 修改程序 interest.c ,使得修改后的程序可以每月整合一次利息,而不再是每年整合一次利息。程
 * 序的输出格式不变;余额应该始终按每年一次的间隔显示。
 */

/* Print a table of compound interest */

#include <stdio.h>

#define ARRAY_ITEM_COUNT(a) ((int)(sizeof(a) / sizeof(a[0])))
#define INITIAL_BALANCE 100.00

int main()
{
	int i, low_rate, num_years, year, month;
	double value[8];

	printf("Enter interest rate: ");
	scanf("%d", &low_rate);
	printf("Enter number of years: ");
	scanf("%d", &num_years);

	printf("\nYears");
	for (i = 0; i < ARRAY_ITEM_COUNT(value); ++i)
	{
		printf("\t%d%%", low_rate + i);
		value[i] = INITIAL_BALANCE;
	}
	printf("\n");

	for (year = 1; year <= num_years; ++year)
	{
		printf("%d", year);
		for (i = 0; i < ARRAY_ITEM_COUNT(value); ++i)
		{
			for (month = 1; month <= 12; ++month) {
				value[i] += (low_rate + i) / 100.0 * value[i];
			}
			
			printf("\t%.2f", value[i]);
		}
		printf("\n");
	}

	return 0;
}


================================================
FILE: codes/CProgramming/ch08_数组/ex_07.c
================================================
/*
 * 在线运动的名人之一是一个称为 BIFF 的家伙,他在编写消息上有独一无二的方法。下面是一条典
 * 型的 BIFF 公告:
 *
 * H3Y DUD3, C 15 R1LLY C00L!!!!!!!!!!
 *
 * 编写一个“ BIFF 过滤器”,它可以读取用户录入的消息并且把此消息翻译成 BIFF 的表达风格:
 *
 * Enter message: Hey dude, C is rilly cool
 * In BIFF-speak: H3Y DUD3, C 15 R1LLY C00L!!!!!!!!!!
 *
 * 程序需要把消息转换成大写字母,用数字代替特定的字母(A->4, B->8, E->3, I->1, O->0, S->5),然
 * 后添加10个感叹号。提示:在字符数组中存储原始消息,然后从数组头开始逐个翻译并且显示字符。
 */

#include <stdio.h>
#include <ctype.h>

#define MESSAGE_LEN 32

int main()
{
	char message[MESSAGE_LEN + 1];
	char word;
	int i, word_cnt;

	word_cnt = 0;

	printf("Enter message: ");
	while ((word = getchar()) != '\n') {
		message[word_cnt] = toupper(word);
		++word_cnt;

		if (word_cnt >= MESSAGE_LEN) break;
	}
	message[word_cnt] = '\0';

	for (i = 0; i < word_cnt; ++i) {
		switch (message[i]) {
			case 'A' : message[i] = '4'; break;
			case 'B' : message[i] = '8'; break;
			case 'E' : message[i] = '3'; break;
			case 'I' : message[i] = '1'; break;
			case 'O' : message[i] = '0'; break;
			case 'S' : message[i] = '5'; break;
		}
	}

	printf("In BIFF-speak: %s!!!!!!!!!!\n", message);

	return 0;
}


================================================
FILE: codes/CProgramming/ch08_数组/ex_08.md
================================================
“问与答”小节介绍了使用字母作为数组下标的方法。请描述一下如何使用数字(字符格式的)作为数组的下标。

---

用字符格式的数字减去`'0'`。


================================================
FILE: codes/CProgramming/ch08_数组/ex_09.c
================================================
/*
 * 计算器、手表和其他电子设备经常依靠七段显示器进行数值的输出。为了组成数字,这类设备需要“打
 * 开”7个显示段中的某些部分,同时还需要“关闭”七个显示段中的其他部分:
 *
 * 。。。
 *
 *   0
 *   -
 * 5| |1
 *   - 6
 * 4| |2
 *   -
 *   3
 *
 * (后续描述过于复杂,不书写于此)
 */

#include <stdio.h>

int main()
{
	const int segments[10][7] = {
		{1, 1, 1, 1, 1, 1, 0},
		{0, 1, 1, 0, 0, 0, 0},
		{1, 1, 0, 1, 1, 0, 1},
		{1, 1, 1, 1, 0, 0, 1},
		{0, 1, 2, 0, 0, 1, 1},
		{1, 0, 1, 1, 0, 1, 1},
		{1, 0, 1, 1, 1, 1, 1},
		{1, 1, 1, 0, 0, 0, 0},
		{1, 1, 1, 1, 1, 1, 1},
		{1, 1, 1, 1, 0, 1, 1}
	};

	(void)segments;

	return 0;
}


================================================
FILE: codes/CProgramming/ch08_数组/ex_10.c
================================================
/*
 * 利用8.2节的简洁描述对数组 segments (练习9中)的初始化式尽可能地进行化简。
 */

/*
 * 计算器、手表和其他电子设备经常依靠七段显示器进行数值的输出。为了组成数字,这类设备需要“打
 * 开”7个显示段中的某些部分,同时还需要“关闭”七个显示段中的其他部分:
 *
 * 。。。
 *
 *   0
 *   -
 * 5| |1
 *   - 6
 * 4| |2
 *   -
 *   3
 *
 * (后续描述过于复杂,不书写于此)
 */

#include <stdio.h>

int main()
{
	const int segments[10][7] = {
		{1, 1, 1, 1, 1, 1, 0},
		{0, 1, 1},
		{1, 1, 0, 1, 1, 0, 1},
		{1, 1, 1, 1, 0, 0, 1},
		{0, 1, 2, 0, 0, 1, 1},
		{1, 0, 1, 1, 0, 1, 1},
		{1, 0, 1, 1, 1, 1, 1},
		{1, 1, 1},
		{1, 1, 1, 1, 1, 1, 1},
		{1, 1, 1, 1, 0, 1, 1}
	};

	(void)segments;

	return 0;
}


================================================
FILE: codes/CProgramming/ch08_数组/ex_11.c
================================================
/*
 * 编写程序,要求此程序可以用来读取一个 5*5 的整数数组,然后显示出每行的求和结果和每列的
 * 求和结果。
 *
 * Enter row 1: 8 3 9 0 10
 * Enter row 2: 3 5 17 1 1
 * Enter row 3: 2 8 6 23 1
 * Enter row 4: 15 7 3 2 9
 * Enter row 5: 6 14 2 6 0
 *
 * Row totals: 30 27 40 36 28
 * Column totals: 34 37 37 32 21
 */

#include <stdio.h>

int main()
{
	int arr[5][5];
	int i, j;
	int sum;

	for (i = 0; i < 5; i++) {
		printf("Enter row %d: ", i + 1);
		for (j = 0; j < 5; j++) {
			scanf("%d", &arr[i][j]);
		}
	}

	printf("Row totals:");
	for (i = 0; i < 5; i++) {
		sum = 0;
		for (j = 0; j < 5; j++) {
			sum += arr[i][j];
		}
		printf(" %d", sum);
	}
	printf("\n");

	printf("Column totals:");
	for (j = 0; j < 5; j++) {
		sum = 0;
		for (i = 0; i < 5; ++i) {
			sum += arr[i][j];
		}
		printf(" %d", sum);
	}
	printf("\n");

	return 0;
}


================================================
FILE: codes/CProgramming/ch08_数组/ex_12.c
================================================
/*
 * 修改练习11,要求修改后的程序可以提示每个学生5门测验的成绩,一共有5个学生,然后计算每个学
 * 生的5门测验的总分和平均分,还要列出每门测验的平均分、高分和低分。
 */

/*
 * 编写程序,要求此程序可以用来读取一个 5*5 的整数数组,然后显示出每行的求和结果和每列的
 * 求和结果。
 *
 * Enter row 1: 8 3 9 0 10
 * Enter row 2: 3 5 17 1 1
 * Enter row 3: 2 8 6 23 1
 * Enter row 4: 15 7 3 2 9
 * Enter row 5: 6 14 2 6 0
 *
 * Row totals: 30 27 40 36 28
 * Column totals: 34 37 37 32 21
 */

#include <stdio.h>

int main()
{
	int arr[5][5];
	int i, j;
	int sum;
	float avg[5];
	int min[5], max[5];

	for (i = 0; i < 5; i++) {
		printf("Enter score of student%d: ", i + 1);
		for (j = 0; j < 5; j++) {
			scanf("%d", &arr[i][j]);
		}
	}

	for (i = 0; i < 5; i++) {
		sum = 0;
		for (j = 0; j < 5; j++)
			sum += arr[i][j];

		printf("student%d total score: %d, average score: %.2f\n", i + i, sum, sum / 5.0);
	}

	for (j = 0; j < 5; j++) {
		i = 0;
		sum = 0;
		min[j] = max[j] = arr[i][j];
		for (; i < 5; ++i) {
			sum += arr[i][j];

			if (min[j] > arr[i][j]) min[j] = arr[i][j];
			if (max[j] < arr[i][j]) max[j] = arr[i][j];
		}
	
		avg[j] = sum / 5.0;
	}

	printf("Avg score:");
	for (i = 0; i < 5; i++) printf(" %.2f", avg[i]);
	printf("\n");

	printf("Min score:");
	for (i = 0; i < 5; i++) printf(" %d", min[i]);
	printf("\n");

	printf("Max score:");
	for (i = 0; i < 5; i++) printf(" %d", max[i]);
	printf("\n");

	return 0;
}


================================================
FILE: codes/CProgramming/ch08_数组/ex_13.c
================================================
/*
 * 描述见书本。
 */

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main()
{
	char matrix[10][10];
	int i, j, x, y;
	int tmp, hit[4];
	char word;
	int find;

	for (i = 0; i < 10; i++)
		for (j = 0; j < 10; j++)
			matrix[i][j] = '.';

	srand(time(NULL));

	word = 'A';
	x = y = 0;
	
	matrix[x][y] = word;
	while (word != 'Z') {
		for (i = 0; i < 4; i++) hit[i] = 0;

		find = 0;

		do {
			i = x;
			j = y;
			tmp = rand() % 4;
			hit[tmp] = 1;
			switch (tmp) {
				case 0 : j--; break;
				case 1 : j++; break;
				case 2 : i--; break;
				case 3 : i++; break;
			}

			if (i >= 0 && i < 10 && j >= 0 && j < 10 && matrix[i][j] == '.') {
				find = 1;
				break;
			}

			if (hit[0] && hit[1] && hit[2] && hit[3]) {
				break;
			}

		} while (1);

		if (!find) break;

		++word;
		matrix[i][j] = word;

		x = i;
		y = j;
	}
	
	for (i = 0; i < 10; i++) {
		for (j = 0; j < 10; j++) {
			putchar(matrix[i][j]);
			putchar(' ');
		}
		putchar(10);
	}
	

	return 0;
}


================================================
FILE: codes/CProgramming/ch08_数组/interest.c
================================================
/* Print a table of compound interest */

#include <stdio.h>

#define ARRAY_ITEM_COUNT(a) ((int)(sizeof(a) / sizeof(a[0])))
#define INITIAL_BALANCE 100.00

int main()
{
	int i, low_rate, num_years, year;
	double value[8];

	printf("Enter interest rate: ");
	scanf("%d", &low_rate);
	printf("Enter number of years: ");
	scanf("%d", &num_years);

	printf("\nYears");
	for (i = 0; i < ARRAY_ITEM_COUNT(value); ++i)
	{
		printf("%6d%%", low_rate + i);
		value[i] = INITIAL_BALANCE;
	}
	printf("\n");

	for (year = 1; year <= num_years; ++year)
	{
		printf("%3d     ", year);
		for (i = 0; i < ARRAY_ITEM_COUNT(value); ++i)
		{
			value[i] += (low_rate + i) / 100.0 * value[i];
			printf("%7.2f", value[i]);
		}
		printf("\n");
	}

	return 0;
}


================================================
FILE: codes/CProgramming/ch08_数组/repdigit.c
================================================
/*
 * 程序:检查数中重复出现的数字(p101)
 *
 * Enter a number: 28212
 * Repeated digit
 */

/* Checks numbers for repeated digits */

#include <stdio.h>

#define TRUE 1
#define FALSE 0

typedef int Bool;

int main()
{
	Bool digit_seen[10] = {0};
	int digit;
	long int n;

	printf("Enter a number: ");
	scanf("%ld", &n);

	while (n > 0) {
		digit = n % 10;
		if (digit_seen[digit])
			break;
		digit_seen[digit] = TRUE;
		n /= 10;
	}

	if (n > 0)
		printf("Repeated digit\n\n");
	else
		printf("No repeated digit\n\n");

	return 0;
}


================================================
FILE: codes/CProgramming/ch08_数组/reverse.c
================================================
/*
 * 程序:数列反向(p100)
 *
 * Enter 10 numbers: 34 82 49 102 7 94 23 11 50 31
 * In reverse order: 31 50 11 23 94 7 102 49 82 34
 */

/* Reverses a series of numbers */

#include <stdio.h>

#define N 10

int main()
{
	int a[N], i;

	printf("Enter %d numbers: ", N);
	for (i = 0; i < N; ++i)
		scanf("%d", &a[i]);

	printf("In reverse order:");
	for (i = N - 1; i >= 0; i--)
		printf(" %d", a[i]);
	printf("\n");

	return 0;
}


================================================
FILE: codes/CProgramming/ch09_函数/average.c
================================================
/* Computes pairwise average of three numbers. */

#include <stdio.h>

double average(double a, double b)
{
	return (a + b) / 2;
}

int main()
{
	double x, y, z;

	printf("Enter three numbers: ");
	scanf("%lf%lf%lf", &x, &y, &z);

	printf("average of %g and %g: %g\n", x, y, average(x, y));
	printf("average of %g and %g: %g\n", x, z, average(x, z));
	printf("average of %g and %g: %g\n", z, y, average(z, y));

	return 0;
}


================================================
FILE: codes/CProgramming/ch09_函数/build.sh
================================================
#! /bin/bash

# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]

all_c_files=`ls *.c`
exclude_files=""

is_exclude_file() {
	for file in $exclude_files; do
		if [ "$file" = "$1" ]; then
			return 0
		fi
	done

	return 1
}

main() {
	for c_file in $all_c_files; do
		exe_file=${c_file%%.c*}

		if [ "$1" == "clear" ]; then
			rm -f $exe_file
			continue
		fi

		if is_exclude_file $c_file; then
			continue
		fi

		if [ $exe_file -nt $c_file ] && [ "$1" != "rebuild" ]; then
			continue
		fi

		echo "[BUILDING] $c_file -> $exe_file"
		gcc -g -Wall $c_file -o $exe_file

		if [ "$?" != "0" ]; then
			return 1
		fi
	done

	return 0
}

main $1

exit $?


================================================
FILE: codes/CProgramming/ch09_函数/countdown.c
================================================
/* Prints a countdown */

#include <stdio.h>

void print_count(int n)
{
	printf("T minus %2d and counting\n", n);
}

int main()
{
	int i;

	for (i = 10; i > 0; --i)
	{
		print_count(i);
	}

	return 0;
}


================================================
FILE: codes/CProgramming/ch09_函数/ex_01.c
================================================
/*
 * 下面计算三角形面积的函数有两处错误。找出这些错误,并且说明修改它们的方法。(提示:公式没有
 * 错误)
 *
 * float triangle_area(float base, height)
 * float product;
 * {
 * 	product = base * height;
 * 	return (product / 2);
 * }
 */

/*
 * 形参列表写法错误,应该为 float base, float height
 * product 的声明位置有错,应该在大括号里
 */

#include <stdio.h>

float triangle_area(float base, float height)
{
	float product;
	product = base * height;
	return (product / 2);
}

int main()
{
	printf("%g\n", triangle_area(3, 4));

	return 0;
}


================================================
FILE: codes/CProgramming/ch09_函数/ex_02.c
================================================
/*
 * 编写函数check(x, y, n):如果x和y都落在0到n-1的闭区间内,那么使得函数check返回1。否则,
 * 函数应该返回0。假设x、y和n都是 int  类型。
 */

#include <stdio.h>

int check(int x, int y, int n)
{
	if (x >= 0 && x < n && y >= 0 && y < n) return 1;

	return 0;
}

int main()
{
	printf("%d\n", check(1, 2, 3));
	printf("%d\n", check(1, 2, 2));

	return 0;
}


================================================
FILE: codes/CProgramming/ch09_函数/ex_03.c
================================================
/*
 * 编写函数gcd(m,n)用来计算整数m和n的最大公约数。(第6章的练习2描述了计算最大公约数的Euclid算法)
 */

/*
 * 编写程序,要求用户输入两个整数,然后计算并显示这两个整数的最大公约数(GCD):
 * 
 * Enter two integers: 12 28
 * Greatest common divisor: 4
 *
 * 提示:求最大公约数的经典算法是 Euclid 算法,方法如下:分别让变量m和n存储两个数的值;用m除
 * 以n;把除数保存在m中,而把余数保存在n中;如果n为0,那么停止操作,m中的值是GCD;否则,
 * 从m除以n开始,重复上述除法过程。
 */

#include <stdio.h>

int gcd(int m, int n)
{
	int tmp;

	while (n != 0) {
		tmp = m;
		m = n;
		n = tmp % n;
	}

	return m;
}

int main()
{
	int m, n;

	printf("Enter two integers: ");
	scanf("%d%d", &m, &n);

	printf("Greatest common divisor: %d\n", gcd(m, n));

	return 0;
}


================================================
FILE: codes/CProgramming/ch09_函数/ex_04.c
================================================
/*
 * 编写函数 day_of_year(month, day, year) , 使得函数返回某 month 某 day 是 year 这一年中的
 * 第几天(1和366之间的整数)。
 */

#include <stdio.h>

#define TRUE 1
#define FALSE 0

typedef int Bool;

Bool is_leap_year(int year)
{
	if (0 != year % 100) return 0 == year % 4;

	return 0 == year % 400;
}

int day_of_year(int month, int day, int year)
{
	int days;
	int i;

	int month_days[12] = {
		31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
	};

	if (is_leap_year(year)) month_days[1]++;

	days = 0;
	for (i = 0; i < month - 1; i++) {
		days += month_days[i];
	}

	days += day;

	return days;
}

int main()
{
	int month, day, year;
	
	printf("Enter month day year: ");
	scanf("%d%d%d", &month, &day, &year);

	printf("days: %d\n", day_of_year(month, day, year));

	return 0;
}


================================================
FILE: codes/CProgramming/ch09_函数/ex_05.c
================================================
/*
 * 编写函数 num_digits(n) , 使得函数返回正整数n中数字的个数。提示:为了确定n中的数字的个数,
 * 把这个数反复除以10.当n达到0时,除法的次数表明了n最初拥有的数字的个数。
 */

#include <stdio.h>

int num_digits(n)
{
	int cnt = 0;
	do {
		n /= 10;
		++cnt;
	} while (n != 0);

	return cnt;
}

int main()
{
	int n;
	printf("Enter num: ");
	scanf("%d", &n);

	printf("digits: %d\n", num_digits(n));

	return 0;
}


================================================
FILE: codes/CProgramming/ch09_函数/ex_06.c
================================================
/*
 * 编写函数 digit(n, k) , 使得函数返回正整数n中第k个数字(从右边算起)。例如,digit(829, 1)
 * 返回9, digit(829, 2) 返回2,而 digit(829, 3) 则返回8。如果k大于n所含的数字的个数,那么
 * 函数返回-1。
 */

#include <stdio.h>

int digit(int n, int k)
{
	int i, tmp;

	i = 0;
	do {
		tmp = n % 10;
		n /= 10;

		i++;
		if (i == k) return tmp;
	
	} while (n != 0);

	return -1;
}

int main()
{
	int n, k;

	printf("Enter n k: ");
	scanf("%d%d", &n, &k);

	printf("%d", digit(n, k));

	return 0;
}


================================================
FILE: codes/CProgramming/ch09_函数/ex_07.c
================================================
/*
 * 假设函数f有下列定义:
 *
 * int f(int a, int b) { ... }
 *
 * 那么下列哪条语句是合法的?(假设i的类型为 int 而x的类型为 float 。)
 */

int f(int a, int b) { return 0; }

int main()
{
	int i;
	float x;

	(void)i;
	(void)x;

	/* a 合法 */
	i = f(83, 12);

	/* b 合法 */
	x = f(83, 12);

	/* c 合法 */
	i = f(3.15, 9.28);

	/* d 合法 */
	x = f(3.15, 9.28);

	/* e 合法 */
	f(83, 12);

	return 0;
}


================================================
FILE: codes/CProgramming/ch09_函数/ex_08.md
================================================
对于返回为空且有一个 float 型形式参数的函数,下列哪个函数原型是有效的?

(a) void f(float x);

(b) void f(float);

(c) void f(x);

(d) f(float x);

---

(a), (b)


================================================
FILE: codes/CProgramming/ch09_函数/ex_09.c
================================================
/*
 * 下列程序的输出是什么?
 */

/*
 * x = 1, y = 2
 */

#include <stdio.h>

void swap(int a, int b);

int main()
{
	int x = 1, y = 2;

	swap(x, y);
	printf("x = %d, y = %d\n", x, y);

	return 0;
}

void swap(int a, int b)
{
	int temp;

	temp = a;
	a = b;
	b = temp;
}


================================================
FILE: codes/CProgramming/ch09_函数/ex_10.c
================================================
/*
 * 编写函数,使得函数返回下列值。(假设a和n是形式参数,其中a是有 int 型值的数组,而n则是数组
 * 的长度。)
 *
 * (a) 数组a中的最大元素
 * (b) 数组a中所有元素的平均值
 * (c) 数组a中正数元素的数量
 */

#include <stdio.h>

#define ARRAY_SZ (int)(sizeof(a) / sizeof(a[0]))

int array_max_element(int array[], int count);
int array_average(int array[], int count);
int array_positive_count(int array[], int count);

int main()
{
	int a[] = {1, 42, -3, -10, 6, -8};

	printf("array max element: %d\n", array_max_element(a, ARRAY_SZ));
	printf("array average: %d\n", array_average(a, ARRAY_SZ));
	printf("array positive count: %d\n", array_positive_count(a, ARRAY_SZ));

	return 0;
}

int array_max_element(int array[], int count)
{
	int max_number = array[0];
	int i;

	for (i = 1; i < count; i++) {
		if (max_number < array[i]) max_number = array[i];
	}

	return max_number;
}

int array_average(int array[], int count)
{
	int sum = 0;
	int i;

	for (i = 0; i < count; i++) {
		sum += array[i];
	}

	return sum / count;
}

int array_positive_count(int array[], int count)
{
	int positive_cnt = 0;
	int i;

	for (i = 0; i < count; i++) {
		if (array[i] > 0) positive_cnt++;
	}

	return positive_cnt;
}


================================================
FILE: codes/CProgramming/ch09_函数/ex_11.md
================================================
如果数组a的所有元素值都为0,那么假设下列函数返回 TRUE ;如果数组的所有元素都是非零的,则函数返回 FALSE 。可惜的是,此函数有错误。请找出错误并说明修改它的方法。

```c
Bool has_zero(int a[], int n)
{
	int i;
	for (i = 0; i < n; i++)
		if (a[i] == 0)
			return TRUE;
		else
			return FALSE;
}
```

---

题目描述似有误,应该是如果有元素为0,那么返回 TRUE ,否则返回 FALSE 。

这样是这样的:

```c
Bool has_zero(int a[], int n)
{
	int i;
	for (i = 0; i < n; i++)
		if (a[i] == 0) return TRUE;

	return FALSE;
}
```


================================================
FILE: codes/CProgramming/ch09_函数/ex_12.c
================================================
/*
 * 下面的(不要弄混)函数用来找到三个数的中间数。重新编写函数,使得它只有一条 return 语句。
 *
 * float median(float x, float y, float z)
 * {
 * 	if (x <= y)
 * 		if (y <= z) return y;
 * 		else if (x <= z) return z;
 * 		else return x;
 *
 * 	if (z <= y) return y;
 * 	if (x <= z) return x;
 * 	return z;
 * }
 */

#include <stdio.h>

float median(float x, float y, float z)
{
	float mid = z;

	if (x <= y)
		if (y <= z) mid = y;
		else if (x <= z) mid = z;
		else mid = x;
	else {
		if (z <= y) mid = y;
		if (x <= z) mid = x;
	}

	return mid;
}

int main()
{
	float x, y, z;
	printf("Enter 3 float: ");
	scanf("%f%f%f", &x, &y, &z);

	printf("median: %g\n", median(x, y, z));

	return 0;
}


================================================
FILE: codes/CProgramming/ch09_函数/ex_13.c
================================================
/*
 * 请采用精简 power 函数的方法,来简化 fact 函数。
 */

#include <stdio.h>

int fact(int n)
{
	return n <= 1 ? 1 : n * fact(n - 1);
}

int main()
{
	printf("fact(5): %d\n", fact(5));

	return 0;
}


================================================
FILE: codes/CProgramming/ch09_函数/ex_14.c
================================================
/*
 * 请重新编写 fact 函数,使得编写后的函数不再递归。
 */

#include <stdio.h>

int fact(int n)
{
	int res = 1, i;

	for (i = 2; i <= n; i++) {
		res *= i;
	}

	return res;
}

int main()
{
	printf("fact(5): %d\n", fact(5));

	return 0;
}


================================================
FILE: codes/CProgramming/ch09_函数/ex_15.c
================================================
/*
 * 编写递归版本的 gcd 函数(参加练习3)。有一种用于计算 gcd(m, n) 的策略;如果 n 为0,那么返回m;
 * 否则,递归地调用 gcd 函数,把n作为第一个实际参数进行传递,而把 m % n 作为第二个实际参数进行传
 * 递。
 */

#include <stdio.h>

int gcd(int m, int n)
{
	return n == 0 ? m : gcd(n, m % n);
}

int main()
{
	int m, n;

	printf("Enter two number: ");
	scanf("%d%d", &m, &n);

	printf("gcd: %d\n", gcd(m, n));

	return 0;
}


================================================
FILE: codes/CProgramming/ch09_函数/ex_16.c
================================================
/*
 * 思考下面这个“神秘的”函数:
 * void pb(int n)
 * {
 * 	if (n != 0) {
 * 		pb(n / 2);
 * 		putchar('O' + n % 2);
 * 	}
 * }
 *
 * 手动跟踪函数的执行,然后编写程序调试此函数,把用户录入的数传递给此函数。函数做了什么?
 */

/*
 * 递归输出一些内容,每次调用输出O或者P
 */

#include <stdio.h>

void pb(int n)
{
	if (n != 0) {
		pb(n / 2);
		putchar('O' + n % 2);
	}
}

int main()
{
	int n;
	printf("Enter n: ");
	scanf("%d", &n);

	pb(n);

	return 0;
}


================================================
FILE: codes/CProgramming/ch09_函数/ex_17.c
================================================
/*
 * 编写程序,要求用户录入一串整数(把这串整数存储在数组中),然后通过调用 selection_sort 函数
 * 来排序这些整数。在给定n个元素的数组后, selection_sort 函数必须做下列工作:
 * (a) 搜索数组找出数组中最大的元素,然后把它移到数组的最后
 * (b) 递归地调用函数本身来对前n-1个数组元素进行排序
 */

#include <stdio.h>

#define ARR_LEN 5

void selection_sort(int array[], int count)
{
	int i;
	int max_index, tmp;

	if (count <= 1) return;

	max_index = 0;
	for (i = 0; i < count; i++) {
		if (array[max_index] < array[i])
			max_index = i;
	}

	tmp = array[count - 1];
	array[count - 1] = array[max_index];
	array[max_index] = tmp;

	selection_sort(array, count - 1);
}

int main()
{
	int array[ARR_LEN];
	int i;
	printf("Enter numbers: ");
	for (i = 0; i < ARR_LEN; i++) {
		scanf("%d", &array[i]);
	}

	selection_sort(array, ARR_LEN);

	for (i = 0; i < ARR_LEN; i++) {
		printf("%d ", array[i]);
	}
	printf("\n");

	return 0;
}


================================================
FILE: codes/CProgramming/ch09_函数/prime.c
================================================
/* Tests whether a number is prime */

#include <stdio.h>

int is_prime(int n)
{
	int divisor;

	if (n <= 1) return 0;

	for (divisor = 2; divisor * divisor <= n; ++ divisor)
	{
		if (n % divisor == 0)
		{
			return 0;
		}
	}

	return 1;
}

int main()
{
	int n;

	printf("Enter a number: ");
	scanf("%d", &n);

	if (is_prime(n))
	{
		printf("Prime\n");
	}
	else
	{
		printf("Not prime\n");
	}

	return 0;
}


================================================
FILE: codes/CProgramming/ch09_函数/pun2.c
================================================
/* Prints a bad pun */

#include <stdio.h>

void print_pun(void)
{
	printf("To C or not to C, that is the question.\n");
}

int main()
{
	print_pun();

	return 0;
}


================================================
FILE: codes/CProgramming/ch09_函数/qsort.c
================================================
/* Sorts an array of integers using Quicksort algorithm */

#include <stdio.h>

#define LEN 10

void quicksort(int a[], int low, int high);
int split(int a[], int low, int high);

int main()
{
	int a[LEN], i;

	printf("Enter %d numbers to be sorted: ", LEN);
	for (i = 0; i < LEN; ++ i)
	{
		scanf("%d", &a[i]);
	}

	quicksort(a, 0, LEN - 1);

	printf("In sorted order:");
	for (i = 0 ; i < LEN; ++ i)
	{
		printf(" %d", a[i]);
	}
	printf("\n");

	return 0;
}

void quicksort(int a[], int low, int high)
{
	int middle;

	if (low >= high) return;
	middle = split(a, low, high);

	quicksort(a, low, middle - 1);
	quicksort(a, middle + 1, high);
}

int split(int a[], int low, int high)
{
	int part_element = a[low];

	for (;;)
	{
		while (low < high && part_element <= a[high])
		{
			high--;
		}
		if (low >= high) break;
		a[low++] = a[high];

		while (low < high && a[low] <= part_element)
		{
			low++;
		}
		if (low >= high) break;
		a[high--] = a[low];
	}

	a[high] = part_element;
	return high;
}


================================================
FILE: codes/CProgramming/ch10_程序结构/build.sh
================================================
#! /bin/bash

# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]

all_c_files=`ls *.c`
exclude_files=""

is_exclude_file() {
	for file in $exclude_files; do
		if [ "$file" = "$1" ]; then
			return 0
		fi
	done

	return 1
}

main() {
	for c_file in $all_c_files; do
		exe_file=${c_file%%.c*}

		if [ "$1" == "clear" ]; then
			rm -f $exe_file
			continue
		fi

		if is_exclude_file $c_file; then
			continue
		fi

		if [ $exe_file -nt $c_file ] && [ "$1" != "rebuild" ]; then
			continue
		fi

		echo "[BUILDING] $c_file -> $exe_file"
		gcc -g -Wall $c_file -o $exe_file

		if [ "$?" != "0" ]; then
			return 1
		fi
	done

	return 0
}

main $1

exit $?


================================================
FILE: codes/CProgramming/ch10_程序结构/ex_01.c
================================================
/*
 * 修改栈示例使它存储字符而不是整数。接下来,增加 main 函数,用来要求用户输入一串圆括号或大
 * 括号,然后指出它们是否正确嵌套:
 *
 * Enter parenteses and/or braces: {{}{}}
 * Parenteses/braces are nested property
 *
 * 提示略。
 */

#include <stdio.h>

#define STACK_SIZE 100
#define true 1
#define false 0

/* external variables */
int contents[STACK_SIZE];
int top = 0;

void make_empty()
{
	top = 0;
}

int is_empty()
{
	return 0 == top;
}

int is_full()
{
	return STACK_SIZE == top;
}

void push(int i)
{
	if ( !is_full())
	{
		contents[top ++] = i;
	}
}

int pop()
{
	if ( !is_empty())
	{
		return contents[-- top];
	}

	return -1;
}

//-------------------------------------

int main()
{
	int c, tmp;
	int check_succ;
	
	printf("Enter parenteses and/or braces: ");
	
	check_succ = true;
	while ((c = getchar()) != '\n') {
		if (c == '{' || c == '(') {
			push(c);
			continue;
		}
		else if (c == '}' || c == ')') {
			tmp = pop(c);
			if (c == '}' && tmp != '{') {
				check_succ = false;
				break;
			}
			else if (c == ')' && tmp != '(') {
				check_succ = false;
				break;
			}
		}
		else {
			check_succ = false;
			break;
		}
	}

	if (!is_empty()) check_succ = false;

	if (check_succ) {
		printf("Parenteses/braces are nested property");
	}
	else {
		printf("Parenteses/braces are not nested property");
	}

	return 0;
}


================================================
FILE: codes/CProgramming/ch10_程序结构/ex_02.md
================================================
下面的程序框架只显示了函数定义和变量声明。

```c
int a;

void f(int b) 
{
	int c;
}

void g(void)
{
	int d;
	{
		int b;
	}
}

main()
{
	int f;
}

```

对于下面每种作用域,列出在此作用域内的所有变量的名字和形式参数的名字:

(a) f函数。

(b) g函数。

(c) 声明e的程序块。

(d) main 函数。

---

(a) 局部自动变量c,形式参数b

(b) 局部自动变量d,局部的程序块内的自动变量b

(c) b

(d) f


================================================
FILE: codes/CProgramming/ch10_程序结构/ex_03.c
================================================
/*
 * 修改poker.c程序,把数组 num_in_rank 和数组 num_in_suit 移入 main 函数。 main 函数将把这
 * 两个数组作为实际参数传递给 read_cards 函数和 analyze_hand 函数。
 */

/*
 * Classifies a poker hand
 */

#include <stdio.h>
#include <stdlib.h>

#define NUM_RANKS 13
#define NUM_SUITS 4
#define NUM_CARDS 5
#define TRUE 1
#define FALSE 0

typedef int Bool;

Bool straight, flush, four, three;
int pairs; /* can be 0, 1, or 2 */

void read_cards(int num_in_rank[], int num_in_suit[]);
void analyze_hand(int num_in_rank[], int num_in_suit[]);
void print_result(void);

/*
 * main: Calls read_cards, analyse_hand, and print_result
 * 		 repeatedly.
 */
int main()
{
	int num_in_rank[NUM_RANKS];
	int num_in_suit[NUM_SUITS];

	for (;;) { /* infinite loop */
		read_cards(num_in_rank, num_in_suit);
		analyze_hand(num_in_rank, num_in_suit);
		print_result();
	}

	return 0;
}

/*
 * read_cards: Reads the cards into the external
 * 			   variables num_in_rank and num_in_suit;
 * 			   checks for bad cards and duplicate cards.
 */
void read_cards(int num_in_rank[], int num_in_suit[])
{
	Bool card_exists[NUM_RANKS][NUM_SUITS];
	char ch, rank_ch, suit_ch;
	int rank, suit;
	Bool bad_card;
	int cards_read = 0;

	for (rank = 0; rank < NUM_RANKS; rank++) {
		num_in_rank[rank] = 0;
		for (suit = 0; suit < NUM_SUITS; ++suit) {
			card_exists[rank][suit] = FALSE;
		}
	}

	for (suit = 0; suit < NUM_SUITS; suit++) {
		num_in_suit[suit] = 0;
	}

	while (cards_read < NUM_CARDS) {
		bad_card = FALSE;

		printf("Enter a card: ");

		rank_ch = getchar();
		switch(rank_ch) {
			case '0':			exit(EXIT_SUCCESS); break;
			case '2':			rank = 0; break;
			case '3':			rank = 1; break;
			case '4':			rank = 2; break;
			case '5':			rank = 3; break;
			case '6':			rank = 4; break;
			case '7':			rank = 5; break;
			case '8':			rank = 6; break;
			case '9':			rank = 7; break;
			case 't': case 'T':	rank = 8; break;
			case 'j': case 'J':	rank = 9; break;
			case 'q': case 'Q': rank = 10;break;
			case 'k': case 'K': rank = 11;break;
			case 'a': case 'A': rank = 12;break;
			default:			bad_card = TRUE;
		}

		suit_ch = getchar();
		switch(suit_ch) {
			case 'c': case 'C':	suit = 0; break;
			case 'd': case 'D': suit = 1; break;
			case 'h': case 'H': suit = 2; break;
			case 's': case 'S': suit = 3; break;
			default:			bad_card = TRUE;
		}

		while ((ch = getchar()) != '\n')
			if (ch != ' ') bad_card = TRUE;

		if (bad_card)
			printf("Bad card; ignored.\n");
		else if (card_exists[rank][suit])
			printf("Duplicate card; ignored.\n");
		else {
			num_in_rank[rank]++;
			num_in_suit[suit]++;
			card_exists[rank][suit] = TRUE;
			cards_read++;
		}
	}
}

/*
 * analyze_hand: Determines whether the hand contains a
 * 			     straight, a flush, four-of-a-kind,
 * 			     and/or a three-of-a-kind; determines the
 * 			     number of pairs; stores the result into
 * 			     the external variables straight, flush,
 * 			     four, three, and pairs.
 */

void analyze_hand(int num_in_rank[], int num_in_suit[])
{
	int num_consec = 0;
	int rank, suit;

	straight = FALSE;
	flush = FALSE;
	four = FALSE;
	three = FALSE;
	pairs = 0;

	/* check for flush */
	for (suit = 0; suit < NUM_SUITS; suit++) {
		if (num_in_suit[suit] == NUM_CARDS)
			flush = TRUE;
	}

	/* check for straight */
	rank = 0;
	while (num_in_rank[rank] == 0) rank++;
	for (; rank < NUM_RANKS && num_in_rank[rank]; ++rank)
		num_consec++;
	if (num_consec == NUM_CARDS) {
		straight = TRUE;
		return;
	}

	/* check for 4-of-kind, 3-of-kind, and pairs */
	for (rank = 0; rank < NUM_RANKS; rank++) {
		if (num_in_rank[rank] == 4) four = TRUE;
		if (num_in_rank[rank] == 3) three = TRUE;
		if (num_in_rank[rank] == 2) pairs++;
	}
}

/*
 * print_result: Notifies the user of the result, using
 * 			     the external variables straight, flush,
 * 			     four, three, and pairs.
 */
void print_result()
{
	if (straight && flush) 	printf("Straight flush\n\n");
	else if (four)			printf("Four of a kind\n\n");
	else if (three &&
			 pairs == 1)	printf("Full house\n\n");
	else if (flush)			printf("Flush\n\n");
	else if (straight)		printf("Straight\n\n");
	else if (three)			printf("Three of a kind\n\n");
	else if (pairs == 2)	printf("Two Pair\n\n");
	else if (pairs == 1)	printf("Pair\n\n");
	else					printf("High card\n\n");
}


================================================
FILE: codes/CProgramming/ch10_程序结构/ex_04.c
================================================
/*
 * 把数组 num_in_rank 、数组 num_in_suit 和数组 card_exists 从 poker.c 程序中去掉。程序改用
 * 5*2d的数组来代替存储牌。
 */

/*
 * Classifies a poker hand
 */

#include <stdio.h>
#include <stdlib.h>

#define NUM_RANKS 13
#define NUM_SUITS 4
#define NUM_CARDS 5
#define TRUE 1
#define FALSE 0

typedef int Bool;

int cards[NUM_CARDS][2]; /* 第一列为 rank ,第二列为 suit */
Bool straight, flush, four, three;
int pairs; /* can be 0, 1, or 2 */

void sort_by_rank(int cards[][2], int count);
Bool card_exists(int cards[][2], int count, int rank, int suit);
void read_cards(void);
void analyze_hand(void);
void print_result(void);

/*
 * main: Calls read_cards, analyse_hand, and print_result
 * 		 repeatedly.
 */
int main()
{
	for (;;) { /* infinite loop */
		read_cards();
		analyze_hand();
		print_result();
	}

	return 0;
}

/*
 * sort_by_rank: 按照 rank 将 cards 排序(升序)
 */
void sort_by_rank(int cards[][2], int count)
{
	int i, max_index, tmp;

	if (count <= 1) return;

	max_index = 0;
	for (i = 1; i < count; i++) {
		if (cards[i][0] > cards[max_index][0])
			max_index = i;
	}

	tmp = cards[count - 1][0];
	cards[count - 1][0] = cards[max_index][0];
	cards[max_index][0] = tmp;

	tmp = cards[count - 1][1];
	cards[count - 1][1] = cards[max_index][1];
	cards[max_index][1] = tmp;

	sort_by_rank(cards, count - 1);
}

/*
 * card_exists: 查询 rank 和 suit 代表的卡牌是否已经存在于 cards
 */
Bool card_exists(int cards[][2], int count, int rank, int suit)
{
	int i;

	for (i = 0; i < count; i++) {
		if (cards[i][0] == rank && cards[i][1] == suit)
			return TRUE;
	}

	return FALSE;
}

/*
 * read_cards: Reads the cards into the external
 * 			   variables num_in_rank and num_in_suit;
 * 			   checks for bad cards and duplicate cards.
 */
void read_cards(void)
{
	char ch, rank_ch, suit_ch;
	int i, j, rank, suit;
	Bool bad_card;
	int cards_read = 0;

	for (i = 0; i < NUM_CARDS; i++) {
		for (j = 0; j < 2; j++) {
			cards[i][j] = -1;
		}
	}

	while (cards_read < NUM_CARDS) {
		bad_card = FALSE;

		printf("Enter a card: ");

		rank_ch = getchar();
		switch(rank_ch) {
			case '0':			exit(EXIT_SUCCESS); break;
			case '2':			rank = 0; break;
			case '3':			rank = 1; break;
			case '4':			rank = 2; break;
			case '5':			rank = 3; break;
			case '6':			rank = 4; break;
			case '7':			rank = 5; break;
			case '8':			rank = 6; break;
			case '9':			rank = 7; break;
			case 't': case 'T':	rank = 8; break;
			case 'j': case 'J':	rank = 9; break;
			case 'q': case 'Q': rank = 10;break;
			case 'k': case 'K': rank = 11;break;
			case 'a': case 'A': rank = 12;break;
			default:			bad_card = TRUE;
		}

		suit_ch = getchar();
		switch(suit_ch) {
			case 'c': case 'C':	suit = 0; break;
			case 'd': case 'D': suit = 1; break;
			case 'h': case 'H': suit = 2; break;
			case 's': case 'S': suit = 3; break;
			default:			bad_card = TRUE;
		}

		while ((ch = getchar()) != '\n')
			if (ch != ' ') bad_card = TRUE;

		if (bad_card)
			printf("Bad card; ignored.\n");
		else if (card_exists(cards, cards_read, rank, suit))
			printf("Duplicate card; ignored.\n");
		else {
			cards[cards_read][0] = rank;
			cards[cards_read][1] = suit;
			cards_read++;
		}
	}
}

/*
 * analyze_hand: Determines whether the hand contains a
 * 			     straight, a flush, four-of-a-kind,
 * 			     and/or a three-of-a-kind; determines the
 * 			     number of pairs; stores the result into
 * 			     the external variables straight, flush,
 * 			     four, three, and pairs.
 */

void analyze_hand()
{
	int num_consec = 0;
	int i, tmp;

	sort_by_rank(cards, NUM_CARDS);

	straight = FALSE;
	flush = FALSE;
	four = FALSE;
	three = FALSE;
	pairs = 0;

	/* check for flush */
	flush = TRUE;
	for (i = 1; i < NUM_CARDS; i++) {
		if (cards[i][1] != cards[0][1])
			flush = FALSE;
	}

	/* check for straight */
	straight = TRUE;
	for (i = 1; i < NUM_CARDS; i++) {
		if (cards[i][0] != cards[i - 1][0] + 1)
			straight = FALSE;
	}

	/* check for 4-of-kind, 3-of-kind, and pairs */
	tmp = cards[0][0];
	num_consec = 1;
	for (i = 1; i < NUM_CARDS; i++) {
		if (cards[i][0] == tmp) {
			num_consec++;
			if (num_consec == 4) four = TRUE;
			if (num_consec == 3) three = TRUE;
			if (num_consec == 2) pairs++;
		}
		else {
			tmp = cards[i][0];
			num_consec = 1;
		}
	}
}

/*
 * print_result: Notifies the user of the result, using
 * 			     the external variables straight, flush,
 * 			     four, three, and pairs.
 */
void print_result()
{
	if (straight && flush) 	printf("Straight flush\n\n");
	else if (four)			printf("Four of a kind\n\n");
	else if (three &&
			 pairs == 1)	printf("Full house\n\n");
	else if (flush)			printf("Flush\n\n");
	else if (straight)		printf("Straight\n\n");
	else if (three)			printf("Three of a kind\n\n");
	else if (pairs == 2)	printf("Two Pair\n\n");
	else if (pairs == 1)	printf("Pair\n\n");
	else					printf("High card\n\n");
}


================================================
FILE: codes/CProgramming/ch10_程序结构/ex_05.c
================================================
/*
 * 修改 poker.c 程序,使其识别牌的额外类别——“同花大顺”(A、K、Q、J,以及同样花色的10)。
 * 同花大顺的级别高于其他所有的类别。
 */

/*
 * Classifies a poker hand
 */

#include <stdio.h>
#include <stdlib.h>

#define NUM_RANKS 13
#define NUM_SUITS 4
#define NUM_CARDS 5
#define TRUE 1
#define FALSE 0

typedef int Bool;

int cards[NUM_CARDS][2]; /* 第一列为 rank ,第二列为 suit */
Bool straight, big_flush, flush, four, three;
int pairs; /* can be 0, 1, or 2 */

void sort_by_rank(int cards[][2], int count);
Bool card_exists(int cards[][2], int count, int rank, int suit);
void read_cards(void);
void analyze_hand(void);
void print_result(void);

/*
 * main: Calls read_cards, analyse_hand, and print_result
 * 		 repeatedly.
 */
int main()
{
	for (;;) { /* infinite loop */
		read_cards();
		analyze_hand();
		print_result();
	}

	return 0;
}

/*
 * sort_by_rank: 按照 rank 将 cards 排序(升序)
 */
void sort_by_rank(int cards[][2], int count)
{
	int i, max_index, tmp;

	if (count <= 1) return;

	max_index = 0;
	for (i = 1; i < count; i++) {
		if (cards[i][0] > cards[max_index][0])
			max_index = i;
	}

	tmp = cards[count - 1][0];
	cards[count - 1][0] = cards[max_index][0];
	cards[max_index][0] = tmp;

	tmp = cards[count - 1][1];
	cards[count - 1][1] = cards[max_index][1];
	cards[max_index][1] = tmp;

	sort_by_rank(cards, count - 1);
}

/*
 * card_exists: 查询 rank 和 suit 代表的卡牌是否已经存在于 cards
 */
Bool card_exists(int cards[][2], int count, int rank, int suit)
{
	int i;

	for (i = 0; i < count; i++) {
		if (cards[i][0] == rank && cards[i][1] == suit)
			return TRUE;
	}

	return FALSE;
}

/*
 * read_cards: Reads the cards into the external
 * 			   variables num_in_rank and num_in_suit;
 * 			   checks for bad cards and duplicate cards.
 */
void read_cards(void)
{
	char ch, rank_ch, suit_ch;
	int i, j, rank, suit;
	Bool bad_card;
	int cards_read = 0;

	for (i = 0; i < NUM_CARDS; i++) {
		for (j = 0; j < 2; j++) {
			cards[i][j] = -1;
		}
	}

	while (cards_read < NUM_CARDS) {
		bad_card = FALSE;

		printf("Enter a card: ");

		rank_ch = getchar();
		switch(rank_ch) {
			case '0':			exit(EXIT_SUCCESS); break;
			case '2':			rank = 0; break;
			case '3':			rank = 1; break;
			case '4':			rank = 2; break;
			case '5':			rank = 3; break;
			case '6':			rank = 4; break;
			case '7':			rank = 5; break;
			case '8':			rank = 6; break;
			case '9':			rank = 7; break;
			case 't': case 'T':	rank = 8; break;
			case 'j': case 'J':	rank = 9; break;
			case 'q': case 'Q': rank = 10;break;
			case 'k': case 'K': rank = 11;break;
			case 'a': case 'A': rank = 12;break;
			default:			bad_card = TRUE;
		}

		suit_ch = getchar();
		switch(suit_ch) {
			case 'c': case 'C':	suit = 0; break;
			case 'd': case 'D': suit = 1; break;
			case 'h': case 'H': suit = 2; break;
			case 's': case 'S': suit = 3; break;
			default:			bad_card = TRUE;
		}

		while ((ch = getchar()) != '\n')
			if (ch != ' ') bad_card = TRUE;

		if (bad_card)
			printf("Bad card; ignored.\n");
		else if (card_exists(cards, cards_read, rank, suit))
			printf("Duplicate card; ignored.\n");
		else {
			cards[cards_read][0] = rank;
			cards[cards_read][1] = suit;
			cards_read++;
		}
	}
}

/*
 * analyze_hand: Determines whether the hand contains a
 * 			     straight, a flush, four-of-a-kind,
 * 			     and/or a three-of-a-kind; determines the
 * 			     number of pairs; stores the result into
 * 			     the external variables straight, flush,
 * 			     four, three, and pairs.
 */

void analyze_hand()
{
	int num_consec = 0;
	int i, tmp;

	sort_by_rank(cards, NUM_CARDS);

	straight = FALSE;
	big_flush = FALSE;
	flush = FALSE;
	four = FALSE;
	three = FALSE;
	pairs = 0;

	/* check for flush */
	flush = TRUE;
	for (i = 1; i < NUM_CARDS; i++) {
		if (cards[i][1] != cards[0][1])
			flush = FALSE;
	}

	/* check for straight */
	straight = TRUE;
	for (i = 1; i < NUM_CARDS; i++) {
		if (cards[i][0] != cards[i - 1][0] + 1)
			straight = FALSE;
	}

	/* check for big flush */
	if (straight && flush) {
		if (cards[0][0] == 8)
			big_flush = TRUE;
	}

	/* check for 4-of-kind, 3-of-kind, and pairs */
	tmp = cards[0][0];
	num_consec = 1;
	for (i = 1; i < NUM_CARDS; i++) {
		if (cards[i][0] == tmp) {
			num_consec++;
			if (num_consec == 4) four = TRUE;
			if (num_consec == 3) three = TRUE;
			if (num_consec == 2) pairs++;
		}
		else {
			tmp = cards[i][0];
			num_consec = 1;
		}
	}
}

/*
 * print_result: Notifies the user of the result, using
 * 			     the external variables straight, flush,
 * 			     four, three, and pairs.
 */
void print_result()
{
	if (big_flush)			printf("Big flush\n\n");
	else if (straight && flush) 	printf("Straight flush\n\n");
	else if (four)			printf("Four of a kind\n\n");
	else if (three &&
			 pairs == 1)	printf("Full house\n\n");
	else if (flush)			printf("Flush\n\n");
	else if (straight)		printf("Straight\n\n");
	else if (three)			printf("Three of a kind\n\n");
	else if (pairs == 2)	printf("Two Pair\n\n");
	else if (pairs == 1)	printf("Pair\n\n");
	else					printf("High card\n\n");
}


================================================
FILE: codes/CProgramming/ch10_程序结构/ex_06.c
================================================
/*
 * 修改 poker.c 程序,使其允许“小A顺”(即A、2、3、4和5)。
 */

/*
 * Classifies a poker hand
 */

#include <stdio.h>
#include <stdlib.h>

#define NUM_RANKS 13
#define NUM_SUITS 4
#define NUM_CARDS 5
#define TRUE 1
#define FALSE 0

typedef int Bool;

int cards[NUM_CARDS][2]; /* 第一列为 rank ,第二列为 suit */
Bool straight, small_flush, flush, four, three;
int pairs; /* can be 0, 1, or 2 */

void sort_by_rank(int cards[][2], int count);
Bool card_exists(int cards[][2], int count, int rank, int suit);
void read_cards(void);
void analyze_hand(void);
void print_result(void);

/*
 * main: Calls read_cards, analyse_hand, and print_result
 * 		 repeatedly.
 */
int main()
{
	for (;;) { /* infinite loop */
		read_cards();
		analyze_hand();
		print_result();
	}

	return 0;
}

/*
 * sort_by_rank: 按照 rank 将 cards 排序(升序)
 */
void sort_by_rank(int cards[][2], int count)
{
	int i, max_index, tmp;

	if (count <= 1) return;

	max_index = 0;
	for (i = 1; i < count; i++) {
		if (cards[i][0] > cards[max_index][0])
			max_index = i;
	}

	tmp = cards[count - 1][0];
	cards[count - 1][0] = cards[max_index][0];
	cards[max_index][0] = tmp;

	tmp = cards[count - 1][1];
	cards[count - 1][1] = cards[max_index][1];
	cards[max_index][1] = tmp;

	sort_by_rank(cards, count - 1);
}

/*
 * card_exists: 查询 rank 和 suit 代表的卡牌是否已经存在于 cards
 */
Bool card_exists(int cards[][2], int count, int rank, int suit)
{
	int i;

	for (i = 0; i < count; i++) {
		if (cards[i][0] == rank && cards[i][1] == suit)
			return TRUE;
	}

	return FALSE;
}

/*
 * read_cards: Reads the cards into the external
 * 			   variables num_in_rank and num_in_suit;
 * 			   checks for bad cards and duplicate cards.
 */
void read_cards(void)
{
	char ch, rank_ch, suit_ch;
	int i, j, rank, suit;
	Bool bad_card;
	int cards_read = 0;

	for (i = 0; i < NUM_CARDS; i++) {
		for (j = 0; j < 2; j++) {
			cards[i][j] = -1;
		}
	}

	while (cards_read < NUM_CARDS) {
		bad_card = FALSE;

		printf("Enter a card: ");

		rank_ch = getchar();
		switch(rank_ch) {
			case '0':			exit(EXIT_SUCCESS); break;
			case '2':			rank = 0; break;
			case '3':			rank = 1; break;
			case '4':			rank = 2; break;
			case '5':			rank = 3; break;
			case '6':			rank = 4; break;
			case '7':			rank = 5; break;
			case '8':			rank = 6; break;
			case '9':			rank = 7; break;
			case 't': case 'T':	rank = 8; break;
			case 'j': case 'J':	rank = 9; break;
			case 'q': case 'Q': rank = 10;break;
			case 'k': case 'K': rank = 11;break;
			case 'a': case 'A': rank = 12;break;
			default:			bad_card = TRUE;
		}

		suit_ch = getchar();
		switch(suit_ch) {
			case 'c': case 'C':	suit = 0; break;
			case 'd': case 'D': suit = 1; break;
			case 'h': case 'H': suit = 2; break;
			case 's': case 'S': suit = 3; break;
			default:			bad_card = TRUE;
		}

		while ((ch = getchar()) != '\n')
			if (ch != ' ') bad_card = TRUE;

		if (bad_card)
			printf("Bad card; ignored.\n");
		else if (card_exists(cards, cards_read, rank, suit))
			printf("Duplicate card; ignored.\n");
		else {
			cards[cards_read][0] = rank;
			cards[cards_read][1] = suit;
			cards_read++;
		}
	}
}

/*
 * analyze_hand: Determines whether the hand contains a
 * 			     straight, a flush, four-of-a-kind,
 * 			     and/or a three-of-a-kind; determines the
 * 			     number of pairs; stores the result into
 * 			     the external variables straight, flush,
 * 			     four, three, and pairs.
 */

void analyze_hand()
{
	int num_consec = 0;
	int i, tmp;

	sort_by_rank(cards, NUM_CARDS);

	straight = FALSE;
	small_flush = FALSE;
	flush = FALSE;
	four = FALSE;
	three = FALSE;
	pairs = 0;

	/* check for flush */
	flush = TRUE;
	for (i = 1; i < NUM_CARDS; i++) {
		if (cards[i][1] != cards[0][1])
			flush = FALSE;
	}

	/* check for straight */
	straight = TRUE;
	for (i = 1; i < NUM_CARDS; i++) {
		if (cards[i][0] != cards[i - 1][0] + 1)
			straight = FALSE;
	}

	/* check for small flush */
	if (cards[NUM_CARDS - 1][0] == 12) {
		small_flush = TRUE;
		for (i = 1; i < NUM_CARDS - 1; i++) {
			if (cards[i][0] != cards[i - 1][0] + 1)
				small_flush = FALSE;
		}
	}

	/* check for 4-of-kind, 3-of-kind, and pairs */
	tmp = cards[0][0];
	num_consec = 1;
	for (i = 1; i < NUM_CARDS; i++) {
		if (cards[i][0] == tmp) {
			num_consec++;
			if (num_consec == 4) four = TRUE;
			if (num_consec == 3) three = TRUE;
			if (num_consec == 2) pairs++;
		}
		else {
			tmp = cards[i][0];
			num_consec = 1;
		}
	}
}

/*
 * print_result: Notifies the user of the result, using
 * 			     the external variables straight, flush,
 * 			     four, three, and pairs.
 */
void print_result()
{
	if (straight && flush) 	printf("Straight flush\n\n");
	else if (small_flush)	printf("Small flush\n\n");
	else if (four)			printf("Four of a kind\n\n");
	else if (three &&
			 pairs == 1)	printf("Full house\n\n");
	else if (flush)			printf("Flush\n\n");
	else if (straight)		printf("Straight\n\n");
	else if (three)			printf("Three of a kind\n\n");
	else if (pairs == 2)	printf("Two Pair\n\n");
	else if (pairs == 1)	printf("Pair\n\n");
	else					printf("High card\n\n");
}


================================================
FILE: codes/CProgramming/ch10_程序结构/ex_07.c
================================================
/*
 * 编写下列函数:
 *
 * int *find_middle(int a[], int n);
 *
 * 当传递长度为n的数组a时,函数将返回指向数组的中间元素的指针。(如果n是偶数,选择较大下标的
 * 中间元素。例如,如果n=4,中间元素是a[2],不是a[1]。)
 */

#include <stdio.h>

int *find_middle(int a[], int n);

int main()
{
	int a[5] = {1, 4, 3, 10, 42};
	int b[4] = {42, 100, 10, 2};

	printf("middle of a: %d\n", *find_middle(a, 5));
	printf("middle of b: %d\n", *find_middle(b, 4));

	return 0;
}

int *find_middle(int a[], int n)
{
	return &a[n/2];
}


================================================
FILE: codes/CProgramming/ch10_程序结构/guess.c
================================================
/* Asks user to guess a hidden number */

#include <stdlib.h>
#include <stdio.h>
#include <time.h>

#define MAX_NUMBER 100

/* prototypes */
int new_secret_number();
void read_guesses(int secret_number);

int main()
{
	char command;
	int secret_number;

	printf("Guess the secret_number between 1 and %d.\n", MAX_NUMBER);
	srand((unsigned int)time(0));

	do
	{
		secret_number = new_secret_number();

		printf("A new number has been choosen.\n");

		read_guesses(secret_number);

		printf("Play again? [Y/N] ");
		scanf(" %c", &command);
		printf("\n");

	} while (command == 'Y' || command == 'y');

	return 0;
}


/*
 @return: 生成一个新的随机数
*/
int new_secret_number()
{
	return rand() % MAX_NUMBER + 1;
}

/*
 读取用户输入,判断是否符合secret_number,并给予提示
*/
void read_guesses(int secret_number)
{
	int guess_number, guess_times;

	for (;;)
	{
		++ guess_times;

		printf("Enter guesses: ");
		scanf("%d", &guess_number);

		if (guess_number == secret_number)
		{
			printf("You won in %d guess(es)\n", guess_times);
			break;
		}
		else if (guess_number > secret_number)
		{
			printf("Too high, try again.\n");
		}
		else
		{
			printf("Too low, try again.\n");
		}
	}
}


================================================
FILE: codes/CProgramming/ch10_程序结构/poker.c
================================================
/*
 * Classifies a poker hand
 */

#include <stdio.h>
#include <stdlib.h>

#define NUM_RANKS 13
#define NUM_SUITS 4
#define NUM_CARDS 5
#define TRUE 1
#define FALSE 0

typedef int Bool;

int num_in_rank[NUM_RANKS];
int num_in_suit[NUM_SUITS];
Bool straight, flush, four, three;
int pairs; /* can be 0, 1, or 2 */

void read_cards(void);
void analyze_hand(void);
void print_result(void);

/*
 * main: Calls read_cards, analyse_hand, and print_result
 * 		 repeatedly.
 */
int main()
{
	for (;;) { /* infinite loop */
		read_cards();
		analyze_hand();
		print_result();
	}

	return 0;
}

/*
 * read_cards: Reads the cards into the external
 * 			   variables num_in_rank and num_in_suit;
 * 			   checks for bad cards and duplicate cards.
 */
void read_cards(void)
{
	Bool card_exists[NUM_RANKS][NUM_SUITS];
	char ch, rank_ch, suit_ch;
	int rank, suit;
	Bool bad_card;
	int cards_read = 0;

	for (rank = 0; rank < NUM_RANKS; rank++) {
		num_in_rank[rank] = 0;
		for (suit = 0; suit < NUM_SUITS; ++suit) {
			card_exists[rank][suit] = FALSE;
		}
	}

	for (suit = 0; suit < NUM_SUITS; suit++) {
		num_in_suit[suit] = 0;
	}

	while (cards_read < NUM_CARDS) {
		bad_card = FALSE;

		printf("Enter a card: ");

		rank_ch = getchar();
		switch(rank_ch) {
			case '0':			exit(EXIT_SUCCESS); break;
			case '2':			rank = 0; break;
			case '3':			rank = 1; break;
			case '4':			rank = 2; break;
			case '5':			rank = 3; break;
			case '6':			rank = 4; break;
			case '7':			rank = 5; break;
			case '8':			rank = 6; break;
			case '9':			rank = 7; break;
			case 't': case 'T':	rank = 8; break;
			case 'j': case 'J':	rank = 9; break;
			case 'q': case 'Q': rank = 10;break;
			case 'k': case 'K': rank = 11;break;
			case 'a': case 'A': rank = 12;break;
			default:			bad_card = TRUE;
		}

		suit_ch = getchar();
		switch(suit_ch) {
			case 'c': case 'C':	suit = 0; break;
			case 'd': case 'D': suit = 1; break;
			case 'h': case 'H': suit = 2; break;
			case 's': case 'S': suit = 3; break;
			default:			bad_card = TRUE;
		}

		while ((ch = getchar()) != '\n')
			if (ch != ' ') bad_card = TRUE;

		if (bad_card)
			printf("Bad card; ignored.\n");
		else if (card_exists[rank][suit])
			printf("Duplicate card; ignored.\n");
		else {
			num_in_rank[rank]++;
			num_in_suit[suit]++;
			card_exists[rank][suit] = TRUE;
			cards_read++;
		}
	}
}

/*
 * analyze_hand: Determines whether the hand contains a
 * 			     straight, a flush, four-of-a-kind,
 * 			     and/or a three-of-a-kind; determines the
 * 			     number of pairs; stores the result into
 * 			     the external variables straight, flush,
 * 			     four, three, and pairs.
 */

void analyze_hand()
{
	int num_consec = 0;
	int rank, suit;

	straight = FALSE;
	flush = FALSE;
	four = FALSE;
	three = FALSE;
	pairs = 0;

	/* check for flush */
	for (suit = 0; suit < NUM_SUITS; suit++) {
		if (num_in_suit[suit] == NUM_CARDS)
			flush = TRUE;
	}

	/* check for straight */
	rank = 0;
	while (num_in_rank[rank] == 0) rank++;
	for (; rank < NUM_RANKS && num_in_rank[rank]; ++rank)
		num_consec++;
	if (num_consec == NUM_CARDS) {
		straight = TRUE;
		return;
	}

	/* check for 4-of-kind, 3-of-kind, and pairs */
	for (rank = 0; rank < NUM_RANKS; rank++) {
		if (num_in_rank[rank] == 4) four = TRUE;
		if (num_in_rank[rank] == 3) three = TRUE;
		if (num_in_rank[rank] == 2) pairs++;
	}
}

/*
 * print_result: Notifies the user of the result, using
 * 			     the external variables straight, flush,
 * 			     four, three, and pairs.
 */
void print_result()
{
	if (straight && flush) 	printf("Straight flush\n\n");
	else if (four)			printf("Four of a kind\n\n");
	else if (three &&
			 pairs == 1)	printf("Full house\n\n");
	else if (flush)			printf("Flush\n\n");
	else if (straight)		printf("Straight\n\n");
	else if (three)			printf("Three of a kind\n\n");
	else if (pairs == 2)	printf("Two Pair\n\n");
	else if (pairs == 1)	printf("Pair\n\n");
	else					printf("High card\n\n");
}


================================================
FILE: codes/CProgramming/ch10_程序结构/stack.c
================================================
#include <stdio.h>

#define STACK_SIZE 100

/* external variables */
int contents[STACK_SIZE];
int top = 0;

void make_empty()
{
	top = 0;
}

int is_empty()
{
	return 0 == top;
}

int is_full()
{
	return STACK_SIZE == top;
}

void push(int i)
{
	if ( !is_full())
	{
		contents[top ++] = i;
	}
}

int pop()
{
	if ( !is_empty())
	{
		return contents[-- top];
	}

	return -1;
}

//-------------------------------------

int main()
{
	int i;

	for (i = 0; i < 10; ++ i)
	{
		push(i);
	}

	while ( !is_empty())
	{
		printf("%d\n", pop());
	}

	return 0;
}


================================================
FILE: codes/CProgramming/ch11_指针/build.sh
================================================
#! /bin/bash

# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]

all_c_files=`ls *.c`
exclude_files=""

is_exclude_file() {
	for file in $exclude_files; do
		if [ "$file" = "$1" ]; then
			return 0
		fi
	done

	return 1
}

main() {
	for c_file in $all_c_files; do
		exe_file=${c_file%%.c*}

		if [ "$1" == "clear" ]; then
			rm -f $exe_file
			continue
		fi

		if is_exclude_file $c_file; then
			continue
		fi

		if [ $exe_file -nt $c_file ] && [ "$1" != "rebuild" ]; then
			continue
		fi

		echo "[BUILDING] $c_file -> $exe_file"
		gcc -g -Wall $c_file -o $exe_file

		if [ "$?" != "0" ]; then
			return 1
		fi
	done

	return 0
}

main $1

exit $?


================================================
FILE: codes/CProgramming/ch11_指针/ex_01.md
================================================
如果i是变量,并且p指向i,那么下列哪个表达式是i的别名?

(a) *p

(b) &p

(c) *&p

(d) &*p

(e) *i

(f) &i

(g) *&i

(h) &*i

---

(a) (g)


================================================
FILE: codes/CProgramming/ch11_指针/ex_02.md
================================================
如果i是 int 型变量,而且p和q是指向 int 的指针,下列哪个赋值是合法的?

(a) p = i;

(b) *p = &i;

(c) &p = q;

(d) p = &p;

(e) p = &p;

(f) p = q;

(g) p = *q;

(h) *p = q;

(i) *p = *q;

---

(f) (i)


================================================
FILE: codes/CProgramming/ch11_指针/ex_03.c
================================================
/*
 * 下列函数假设用来计算数组a中元素的和以及平均值,且数组a长度为n。 avg 和 sum 指向函数需要修改
 * 的变量。函数有几个错误,请找出这些错误并修改它们。
 *
 * void avg_sum(float a[], int n, float *avg, float *sum)
 * {
 * 	int i;
 * 	
 * 	sum = 0.0
 * 	for (i = 0; i < n; i++)
 * 		sum += a[i];
 *	avg = sum / n;
 * }
 */

#include <stdio.h>

void avg_sum(float a[], int n, float *avg, float *sum)
{
	int i;

	*sum = 0.0; /* 此处修改 sum -> *sum */
	for (i = 0; i < n; i++)
		*sum += a[i]; /* 此处修改 sum -> *sum */
	*avg = *sum / n; /* 此处修改 sum -> *sum avg -> *avg */
}

int main()
{
	float a[3] = {1.1, 2.2, 3.3};
	float avg, sum;

	avg_sum(a, 3, &avg, &sum);

	printf("avg: %f, sum: %f\n", avg, sum);

	return 0;
}


================================================
FILE: codes/CProgramming/ch11_指针/ex_04.c
================================================
/*
 * 编写下列函数:
 *
 * void swap(int *x, int *y);
 *
 * 当传递两个变量的地址时, swap 函数应该交换两者的值:
 *
 * swap(&x, &y);
 *
 * 利用此函数修改第9章中练习9的程序,使它可以完成这项工作。
 */

#include <stdio.h>

void swap(int *a, int *b);

int main()
{
	int x = 1, y = 2;

	swap(&x, &y);
	printf("x = %d, y = %d\n", x, y);

	return 0;
}

void swap(int *a, int *b)
{
	int temp;

	temp = *a;
	*a = *b;
	*b = temp;
}


================================================
FILE: codes/CProgramming/ch11_指针/ex_05.c
================================================
/*
 * 编写下列函数:
 *
 * void split_time(long int total_sec,
 * 				   int *hr, int *min, int *sec);
 *
 * total_sec 是从午夜计算的秒数表示的时间。hr、min、和sec都是指向变量的指针,这些变量在
 * 函数中分别存储着按小时算(0~23)、按分钟算(0~59)和按秒算(0~59)的等价时间。
 */

#include <stdio.h>

void split_time(long int total_sec, int *hr, int *min, int *sec);

int main()
{
	long int total_sec;
	int hr, min, sec;

	printf("Enter sec: ");
	scanf("%ld", &total_sec);

	split_time(total_sec, &hr, &min, &sec);

	printf("%2.2d:%2.2d:%2.2d\n", hr, min, sec);

	return 0;
}

void split_time(long int total_sec, int *hr, int *min, int *sec)
{
	*hr = total_sec / 3600;
	*min = total_sec / 60 % 60;
	*sec = total_sec % 60;
}


================================================
FILE: codes/CProgramming/ch11_指针/ex_06.c
================================================
/*
 * 编写下列函数:
 *
 * void find_two_largest(int a[], int n, int *largest, int *second_largest);
 *
 * 当传递长度为n的数组a时,函数将在数组a中搜寻最大元素和第二大元素,把它们分别
 * 存储在 largest 和 second_largest 指向的变量中。
 */

#include <stdio.h>

void find_two_largest(int a[], int n, int *largest, int *second_largest);

int main()
{
	int a[5] = {4, 41, 42, 100, 9};
	int largest, second_largest;

	find_two_largest(a, 5, &largest, &second_largest);

	printf("largest: %d, second_largest: %d\n", largest, second_largest);

	return 0;
}

void find_two_largest(int a[], int n, int *largest, int *second_largest)
{
	int i, tmp;

	if (n <= 1) {
		*largest = *second_largest = a[0];
		return;
	}

	*largest = a[0];
	*second_largest = a[1];

	if (*largest < *second_largest) {
		tmp = *largest;
		*largest = *second_largest;
		*second_largest = tmp;
	}

	for (i = 2; i < n; i++) {
		if (*second_largest < a[i]) {
			if (*largest < a[i]) {
				*second_largest = *largest;
				*largest = a[i];
			}
			else if (a[i] != *largest) {
				*second_largest = a[i];
			}
		}
	}
}


================================================
FILE: codes/CProgramming/ch11_指针/maxmin.c
================================================
/*
 * Finds the largest and smallest elements in an array
 */

#include <stdio.h>

#define N 10

void max_min(int a[], int n, int *max, int *min);

int main()
{
	int b[N], i, big, small;

	printf("Enter %d number: ", N);
	for (i = 0; i < N; i++)
		scanf("%d", &b[i]);

	max_min(b, N, &big, &small);

	printf("Largest: %d\n", big);
	printf("Smallest: %d\n", small);

	return 0;
}

void max_min(int a[], int n, int *max, int *min)
{
	int i;

	*max = *min = a[0];
	for (i = 1; i < N; i++) {
		if (a[i] > *max)
			*max = a[i];
		else if (a[i] < *min)
			*min = a[i];
	}
}


================================================
FILE: codes/CProgramming/ch12_指针和数组/build.sh
================================================
#! /bin/bash

# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]

all_c_files=`ls *.c`
exclude_files=""

is_exclude_file() {
	for file in $exclude_files; do
		if [ "$file" = "$1" ]; then
			return 0
		fi
	done

	return 1
}

main() {
	for c_file in $all_c_files; do
		exe_file=${c_file%%.c*}

		if [ "$1" == "clear" ]; then
			rm -f $exe_file
			continue
		fi

		if is_exclude_file $c_file; then
			continue
		fi

		if [ $exe_file -nt $c_file ] && [ "$1" != "rebuild" ]; then
			continue
		fi

		echo "[BUILDING] $c_file -> $exe_file"
		gcc -g -Wall $c_file -o $exe_file

		if [ "$?" != "0" ]; then
			return 1
		fi
	done

	return 0
}

main $1

exit $?


================================================
FILE: codes/CProgramming/ch12_指针和数组/ex_01.c
================================================
/*
 * 假设下列声明是有效的:
 *
 * int a[] = {5, 15, 34, 54, 14, 2, 52, 72};
 * int *p = &a[1], *q = &a[5];
 *
 * (a) *(p + 3)的值是多少?
 *
 * (b) *(q - 3)的值是多少?
 *
 * (c) p-q的值是多少?
 *
 * (d) p<q的结果是真还是假?
 *
 * (e) *p<*q的结果是真还是假?
 */

#include <stdio.h>

int main()
{
	int a[] = {5, 15, 34, 54, 14, 2, 52, 72};
	int *p = &a[1], *q = &a[5];

	/* (a) 14 */
	printf("(a) %d\n", *(p + 3));

	/* (b) 34 */
	printf("(b) %d\n", *(q - 3));

	/* (c) -4 */
	printf("(c) %ld\n", p-q);

	/* (d) true */
	printf("(d) %s\n", p<q ? "true" : "false");

	/* (e) false */
	printf("(e) %s\n", *p<*q ? "true" : "false");

	return 0;
}


================================================
FILE: codes/CProgramming/ch12_指针和数组/ex_02.md
================================================
假设 high, low 和 middle 都是具有相同类型的指针,并且 low 和 high 指向数组元素。下面的语句为什么是不合法的,如何修改它?

```c
middle = (low + hight) / 2;
```

---

因为C语言不支持两个指针相加。改为:

```c
middle = low + (high - low) / 2;
```


================================================
FILE: codes/CProgramming/ch12_指针和数组/ex_03.c
================================================
/*
 * 在下列语句执行后,数组a的内容会是什么?
 */

/*
 * 反转a
 */

#include <stdio.h>

#define N 10

int main()
{
	int a[N] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
	int *p = &a[0], *q = &a[N - 1], temp;

	while (p < q) {
		temp = *p;
		*p++ = *q;
		*q-- = temp;
	}

	for (p = a; p < a + N; p++)
		printf("%d ", *p);
	printf("\n");

	return 0;
}


================================================
FILE: codes/CProgramming/ch12_指针和数组/ex_04.c
================================================
/*
 * (a) 编写程序,用来读取一条消息,然后反向显示出这条消息。程序的输出格式如下:
 *
 * Enter a message: Don't get mad, get even.
 * Reversal is: .neve teg ,dam teg t'noD
 *
 * 提示:读消息一次读取一个字符(用 getchar 函数),并且把这些字符存储在数组中,档数组满了或
 * 者读到字符'\n'时停止读操作。
 *
 * (b) 修改上述程序,用指针来代替整数来跟踪数组中的当前位置。
 */

#include <stdio.h>

#define LEN 30

void solution_a()
{
	char str[LEN + 1] = {0};
	int ch;
	int i, count;

	printf("Enter a message: ");
	count = 0;
	while (count < LEN && (ch = getchar()) != '\n') {
		str[count++] = (char)ch;
	}

	printf("Reversal is: ");
	for (i = count - 1; i >= 0; i--) {
		putchar(str[i]);
	}
	printf("\n");
}

void solution_b()
{
	char str[LEN + 1] = {0};
	int ch;
	char *p;

	printf("Enter a message: ");
	p = str;
	while (p != str + LEN && (ch = getchar()) != '\n') {
		*p++ = (char)ch;
	}

	printf("Reversal is: ");
	while (p != str) {
		putchar(*--p);
	}
	printf("\n");
}

int main()
{
	//solution_a();
	solution_b();

	return 0;
}


================================================
FILE: codes/CProgramming/ch12_指针和数组/ex_05.c
================================================
/*
 * (a) 编写程序,用来读一条消息,然后检查这条消息是否是回文(信息中从左到右的字母和从右到左
 * 的字母完全一样):
 *
 * Enter a message: He lived as a devil, eh?
 * Palindrome
 *
 * Enter a message: Madam, I am Adam.
 * Not a palindrome
 *
 * 忽略所有不是字母的字符。用整型变量来跟踪数组内的位置。
 * (b) 修改上述程序,使用指针来代替整数跟踪数组的位置。
 */

#include <stdio.h>
#include <ctype.h>

#define LEN 30

void solution_a()
{
	char str[LEN + 1] = {0};
	int i, j, count;
	int ch;

	printf("Enter a message: ");
	count = 0;
	while (count < LEN && (ch = getchar()) != '\n') {
		str[count++] = (char)ch;
	}

	i = 0;
	j = count - 1;

	while (i < j) {
		if (!isalpha(str[i])) { i++; continue; }
		if (!isalpha(str[j])) { j--; continue; }

		if (toupper(str[i]) != toupper(str[j])) {
			printf("Not a palindrome\n");
			return;
		}

		i++;
		j--;
	}

	printf("Palindrome\n");
}

void solution_b()
{
	char str[LEN + 1] = {0};
	int ch;
	char *p, *q;

	printf("Enter a message: ");
	p = str;
	while (p != str + LEN && (ch = getchar()) != '\n') {
		*p++ = (char)ch;
	}

	q = p - 1;
	p = str;

	while (p < q) {
		if (!isalpha(*p)) { p++; continue; }
		if (!isalpha(*q)) { q--; continue; }

		if (toupper(*p) != toupper(*q)) {
			printf("Not a palindrome\n");
			return;
		}

		p++;
		q--;
	}

	printf("Palindrome\n");
}

int main()
{
	//solution_a();
	solution_b();

	return 0;
}


================================================
FILE: codes/CProgramming/ch12_指针和数组/ex_06.c
================================================
/*
 * 用指针变量 top_ptr 代替整型变量 top 来重新编写栈函数 make_empty、is_empty 和
 * is_full(10.2节)。
 */

#include <stdio.h>

#define STACK_SIZE 100

/* external variables */
int contents[STACK_SIZE];
int *top_ptr = contents;

void make_empty()
{
	top_ptr = contents;
}

int is_empty()
{
	return contents == top_ptr;
}

int is_full()
{
	return contents + STACK_SIZE == top_ptr;
}

void push(int i)
{
	if ( !is_full())
	{
		*top_ptr++ = i;
	}
}

int pop()
{
	if ( !is_empty())
	{
		return *--top_ptr;
	}

	return -1;
}

//-------------------------------------

int main()
{
	int i;

	for (i = 0; i < 10; ++ i)
	{
		push(i);
	}

	while ( !is_empty())
	{
		printf("%d\n", pop());
	}

	return 0;
}


================================================
FILE: codes/CProgramming/ch12_指针和数组/ex_07.md
================================================
假设a是一维数组而p是指针变量。如果刚执行了赋值操作p = a,那么由于类型不匹配,下列哪些表达式是不合法的?正确的表达式中,哪些为真(即有非零值)?

(a) p == a[0]

(b) p == &a[0]

(c) *p == a[0]

(d) p[0] == a[0]

---

不合法的有:(a)

为真的有:(b) (c) (d)


================================================
FILE: codes/CProgramming/ch12_指针和数组/ex_08.md
================================================
请利用数组名可以用作指针的事实简化练习4中(b)的程序。

---

略。


================================================
FILE: codes/CProgramming/ch12_指针和数组/ex_09.md
================================================
请利用数组名可以用作指针的事实简化练习5中(b)的程序。

---

略。


================================================
FILE: codes/CProgramming/ch12_指针和数组/ex_10.c
================================================
/*
 * 用指针的算术运算代替数组的下标来重新编写下列函数。(换句话说,消除变量i和所有用[]运算的
 * 地方。)改动尽可能少。
 *
 * int sum_array(int a[], int n)
 * {
 * 	int i, sum;
 *
 * 	sum = 0;
 * 	for (i = 0; i < n; i++)
 * 		sum += a[i];
 * 	return sum;
 * }
 */

#include <stdio.h>

int sum_array(int a[], int n)
{
	int *p, sum;

	for (p = a; p < a + n; p++)
		sum += *p;
	return sum;
}

int main()
{
	int a[4] = {1, 2, 3, 4};

	printf("sum: %d\n", sum_array(a, 4));

	return 0;
}


================================================
FILE: codes/CProgramming/ch12_指针和数组/ex_11.c
================================================
/*
 * 编写下列函数:
 *
 * Bool search(int a[], int n, int key);
 *
 * a是要搜寻的数组,n是数组内元素的数量,而且key是搜索键。如果key与数组a的某个元素匹配了,
 * 那么 search 函数必须返回 TRUE ,否则返回 FALSE 。要求使用指针算术运算而不是下标来访问数组元素。
 */

#include <stdio.h>

#define TRUE 1
#define FALSE 0

typedef int Bool;

Bool search(int a[], int n, int key)
{
	int* p;

	for (p = a; p != a + n; p++) {
		if (*p == key) return TRUE;
	}
	return FALSE;
}

int main()
{
	int a[4] = {1, 2, 3, 4};

	printf("1 in array: %s\n", (search(a, 4, 1) ? "yes" : "no"));
	printf("5 in array: %s\n", (search(a, 4, 5) ? "yes" : "no"));

	return 0;
}


================================================
FILE: codes/CProgramming/ch12_指针和数组/ex_12.c
================================================
/*
 * 8.2节有一个代码段是用两个嵌套的for循环初始化数组 ident ,此数组是用作恒等矩阵。请重新编写
 * 这段代码,采用一个指针来逐步访问数组中的元素,且每次一个元素。提示:因为不能用 row 和 col
 * 来索引变量,所以不会容易知道哪里存储1。但是,可以利用数组的第一个元素必须是1这个事实,
 * 接着N个元素都必须是0,再接下来的元素是1,以此类推。用变量来跟踪连续0的数量,并把此变量存储
 * 起来。当计数达到N时,就是存储1的时候了。
 */

#include <stdio.h>

#define N 10

void print(float ident[][N], int count)
{
	int row, col;

	for (row = 0; row < count; row++) {
		for (col = 0; col < N; col++)
			printf("%.1f ", ident[row][col]);
		printf("\n");
	}
}

void book_version()
{
	float ident[N][N];
	int row, col;

	for (row = 0; row < N; row++)
		for (col = 0; col < N; col++)
			if (row == col)
				ident[row][col] = 1.0;
			else
				ident[row][col] = 0.0;

	print(ident, N);
}

void ex_version()
{
	float ident[N][N];
	float *p;
	int cnt_zero;

	cnt_zero = 0;
	for (p = &ident[0][0]; p <= &ident[N-1][N-1]; p++) {
		if (cnt_zero == 0) *p = 1.0;
		else *p = 0.0;

		cnt_zero++;
		if (cnt_zero > N) cnt_zero = 0;
	}

	print(ident, N);
}

int main()
{
	//book_version();
	ex_version();

	return 0;
}


================================================
FILE: codes/CProgramming/ch12_指针和数组/ex_13.c
================================================
/*
 * 假设下列数组含有一周24小时的温度读数,数组的每一行是某一天的读数:
 *
 * int temperatures[7][24];
 *
 * 编写语句,使用 search 函数在整个 temperatures 数组中寻找值32。
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define TRUE 1
#define FALSE 0

typedef int Bool;

Bool search(int a[], int n, int key)
{
	int* p;

	for (p = a; p != a + n; p++) {
		if (*p == key) return TRUE;
	}
	return FALSE;
}

int main()
{
	int temperatures[7][24];

	memset(temperatures, 0, sizeof(temperatures));

	if (search(&temperatures[0][0], 7 * 24, 32)) {
		printf("Find\n");
	}
	else {
		printf("Not Find\n");
	}

	temperatures[1][22] = 32;

	if (search(&temperatures[0][0], 7 * 24, 32)) {
		printf("Find\n");
	}

	return 0;
}


================================================
FILE: codes/CProgramming/ch12_指针和数组/ex_14.c
================================================
/*
 * 编写循环用来显示出(练习13中的)temperatures数组中行i存储的所有温度读数。利用指针来访
 * 问该行中的每个元素。
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define TRUE 1
#define FALSE 0

typedef int Bool;

Bool search(int a[], int n, int key)
{
	int* p;

	for (p = a; p != a + n; p++) {
		if (*p == key) return TRUE;
	}
	return FALSE;
}

int main()
{
	int temperatures[7][24] = {
		{0},
		{22, 25, 26, 0},
		{0},
		{0},
		{0},
		{0},
		{0},
	};

	int *p;
	int i = 1;

	for (p = &temperatures[i][0]; p != &temperatures[i][24]; p++) {
		printf("%d ", *p);
	}
	printf("\n");

	return 0;
}


================================================
FILE: codes/CProgramming/ch12_指针和数组/ex_15.c
================================================
/*
 * 编写循环用来显示(练习13中的)temperatures数组一星期中每一天的最高温度。循环体应该调用
 * find_largest 函数,且一次传递数组的一行。
 */

#include <stdio.h>

int find_largest(int a[], int count)
{
	int max;
	int i;

	max = a[0];
	for (i = 1; i < count; i++) {
		if (a[i] > max) max = a[i];
	}

	return max;
}

int main()
{
	int temperatures[7][24] = {
		{22, 21, 20},
		{20, 19, 17},
		{0},
		{0},
		{0},
		{0},
		{0},
	};

	int i;

	for (i = 0; i < 7; i++) {
		printf("max of day %d: %d\n", i+1, find_largest(&temperatures[i][0], 24));
	}
	
	return 0;
}


================================================
FILE: codes/CProgramming/ch12_指针和数组/reverse2.c
================================================
/*
 * 程序:数列反向(改进版) 
 */

/* Reverses a series of numbers (pointer version) */

#include <stdio.h>

#define N 10

int main()
{
	int a[N], *p;

	printf("Enter %d numbers: ", N);
	for (p = a; p < a + N; p++)
		scanf("%d", p);

	printf("In reverse order:");
	for (p = a + N - 1; p >= a; p--)
		printf(" %d", *p);
	printf("\n");

	return 0;
}


================================================
FILE: codes/CProgramming/ch13_字符串/build.sh
================================================
#! /bin/bash

# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]

all_c_files=`ls *.c`
exclude_files=""

is_exclude_file() {
	for file in $exclude_files; do
		if [ "$file" = "$1" ]; then
			return 0
		fi
	done

	return 1
}

main() {
	for c_file in $all_c_files; do
		exe_file=${c_file%%.c*}.exe

		if [ "$1" == "clear" ]; then
			rm -f $exe_file
			continue
		fi

		if is_exclude_file $c_file; then
			continue
		fi

		if [ $exe_file -nt $c_file ] && [ "$1" != "rebuild" ]; then
			continue
		fi

		echo "[BUILDING] $c_file -> $exe_file"
		gcc -g -Wall $c_file -o $exe_file

		if [ "$?" != "0" ]; then
			return 1
		fi
	done

	return 0
}

main $1

exit $?


================================================
FILE: codes/CProgramming/ch13_字符串/count_space.c
================================================
/*
 * 统计字符串中空格的数量
 */

#include <stdio.h>

int count_space(const char *s)
{
	int count = 0;
	for (; *s != '\0'; s++)
		if (*s == ' ')
			count++;
	return count;
}

int main()
{
	printf("space: %d\n", count_space("Hello World !!"));

	return 0;
}


================================================
FILE: codes/CProgramming/ch13_字符串/ex_01.md
================================================
下面的函数调用应该是写出单独一个换行符,但是其中有一些是错误的。请指出哪些调用是错误的,并说明理由。

(a) printf("%c", '\n'); // 正确

(b) printf("%c", "\n");	// 错误,"\n"的类型是指针,无法匹配转换说明

(c) printf("%s", '\n');	// 错误,'\n'的类型不匹配转换说明符%s

(d) printf("%s", "\n"); // 正确

(e) printf('\n');		// 错误,printf 第一个参数类型是字符串

(f) printf("\n");		// 正确

(g) putchar('\n');		// 正确

(h) putchar("\n");		// 错误,putchar 的参数类型是一个整数

(i) puts('\n');			// 错误,puts 的参数类型是一个字符串

(j) puts("\n");			// 错误,puts 会自动附加一个换行符

(k) puts("");			// 正确

================================================
FILE: codes/CProgramming/ch13_字符串/ex_02.md
================================================
假设p的定义如下所示:

```c
char *p = "abc";
```

下列哪些函数调用是合法的?请说明每个合法的函数调用的输出,并解释为什么其他的是非法的。

(a) putchar(p);		// 非法的,参数类型不匹配

(b) putchar(\*p);	// 合法,输出一个字符a

(c) puts(p);		// 合法,输出字符串"abc\n"

(d) puts(\*p);		// 非法的,参数类型不匹配

================================================
FILE: codes/CProgramming/ch13_字符串/ex_03.c
================================================
/*
 假设按如下方式调用 scanf 函数:
 scanf("%d%s%d", &i, s, &j);
 如果用户输入12abc34 56def78,那么调用后i, s和j的值分别是多少?(假设i和j是int型变量,
 s是字符数组)
*/

/*
 i: 12
 s: abc34
 j: 56
*/

#include <stdio.h>

int main()
{
	int i, j;
	char s[10];

	scanf("%d%s%d", &i, s, &j);

	printf("i: %d\n", i);
	printf("s: %s\n", s);
	printf("j: %d\n", j);

	return 0;
}

================================================
FILE: codes/CProgramming/ch13_字符串/ex_04.c
================================================
/*
 按照下述要求分别实现 read_line 函数:

 (a) 在开始存储输入字符前跳过空白字符。
 (b) 在读入第一个空白字符时停止。提示:调用 isspace 函数来检查字符是否为空白字符。
 (c) 在读入第一个换行符时停止,然后把换行符存储到字符串中。
 (d) 把没有空间存储的字符留下以备后用
*/

#include <stdio.h>
#include <ctype.h>

#define LEN 20

int read_line(char str[], int n)
{
	char ch;
	int i = 0;

	while ((ch = getchar()) != '\n') {
		if (i == 0 && isspace(ch))
			continue;

		if (i != 0 && isspace(ch))
			break;

		if (i < n - 1)
			str[i++] = ch;
	}

	if (i < n - 1)
	{
		str[i++] = '\n';
	}
	
	str[i] = '\0';

	return i;
}

int main()
{
	char str[LEN + 1];
	int len;

	len = read_line(str, LEN);
	printf("read %d charactors: %s\n", len, str);
	len = read_line(str, LEN);
	printf("read %d charactors: %s\n", len, str);

	return 0;
}


================================================
FILE: codes/CProgramming/ch13_字符串/ex_05.c
================================================
/*
 * (a) 编写名为 strcap 的函数用来把参数中的字母都改为大写字母。参数是空字符结尾的字符串,且此
 * 字符串包含任意的 ASCII 字符。使用数组下标的方式访问字符串中的字符。提示:使用 toupper 函数
 * 把每个字符转换成大写。
 *
 * (b) 重写 strcap 函数,这次使用指针来访问字符串中的字符。
 */

#include <stdio.h>
#include <ctype.h>

char* strcap_a(char *s)
{
	int i = 0;
	while (s[i]) {
		if (isalpha(s[i]))
			s[i] = toupper(s[i]);

		i++;
	}

	return s;
}

char* strcap_b(char *s)
{
	char *p = s;
	while (*p) {
		if (isalpha(*p))
			*p = toupper(*p);
		p++;
	}
	return s;
}

int main()
{
	char s[] = "Hello World";

	//printf("to upper: %s\n", strcap_a(s));
	printf("to upper: %s\n", strcap_b(s));

	return 0;
}


================================================
FILE: codes/CProgramming/ch13_字符串/ex_06.c
================================================
/*
 * 编写名为 censor 的函数,用来把字符串中出现的每一处字母"foo"替换为"xxx"。例如,字符串
 * "food fool"会变为"xxxd xxxl"。在不失清晰性的前提下程序越短越好。
 */

#include <stdio.h>
#include <string.h>

char* censor(char *s)
{
	char* cursor;
	char* end;
	int i;

	cursor = s;
	end = s + strlen(s);

	while (cursor + 3 < end) {
		if (0 == strncmp(cursor, "foo", 3)) {
			for (i = 0; i < 3; i++)
				*cursor++ = 'x';
		}
		else
			cursor++;
	}

	return s;
}

int read_line(char str[], int n)
{
	char ch;
	int i = 0;

	while ((ch = getchar()) != '\n') {
		if (i < n)
			str[i++] = ch;
	}
	str[i] = '\0';

	return i;
}

int main()
{
	char s[20];

	printf("Enter str: ");
	read_line(s, 20);


	printf("s: %s\n", censor(s));

	return 0;
}


================================================
FILE: codes/CProgramming/ch13_字符串/ex_07.c
================================================
/*
 * 下面程序的输出是什么?
 *
 * #include <stdio.h>
 *
 * main()
 * {
 * 	char s[] = "Hsjodi", *p;
 *
 * 	for (p = &s[5]; p >= s; p--) --*p;
 * 	puts(s);
 * 	return 0;
 * }
 */

/*
 * Grinch
 */

#include <stdio.h>

int main()
{
	char s[] = "Hsjodi", *p;
	for (p = &s[5]; p >= s; p--) --*p;
		puts(s);

	return 0;
}


================================================
FILE: codes/CProgramming/ch13_字符串/ex_08.c
================================================
/*
 * 函数f如下所示:
 *
 * int f(char *s, char *t)
 * {
 * 	char *p1, *p2;
 *
 * 	for (p1 = s; *p1; p1++) {
 * 		for (p2 = t; *p2; p2++)
 * 			if (*p1 == *p2) break;
 * 		if (*p2 == '\0') break;
 * 	}
 * 	return p1 - s;
 * }
 *
 * (a) f("abcd", "babc") 的值是多少?
 * (b) f("abcd", "bcd") 的值是多少?
 * (c) 通常情况下,当传递两个字符串s和t时,函数的返回值是什么?
 */

/*
 * (a) 3
 * (b) 0
 * (c) 遍历s,对于当前的字符,如果不存在于t中,则返回这个字符所在的位置。
 */

#include <stdio.h>

int f(char *s, char *t)
{
	char *p1, *p2;
	for (p1 = s; *p1; p1++) {
		for (p2 = t; *p2; p2++)
			if (*p1 == *p2) break;
		if (*p2 == '\0') break;
	}
	return p1 - s;
}

int main()
{
	printf("%d\n", f("abcd", "babc"));
	printf("%d\n", f("abcd", "bcd"));

	return 0;
}


================================================
FILE: codes/CProgramming/ch13_字符串/ex_09.md
================================================
假设 str 是字符数组,下面哪条语句与其他3条语句不等价?

(a) *str = 0;

(b) str[0] = '\0';

(c) strcpy(str, "");

(d) strcat(str, "");

---

(d)


================================================
FILE: codes/CProgramming/ch13_字符串/ex_10.c
================================================
/*
 * 在执行下列语句后,字符串 str 的值是什么?
 *
 * strcpy(str, "tire-bouchon");
 * strcpy(&str[4], "d-or-wi");
 * strcat(str, "red?");
 */

/*
 * tired-or-wired?
 */

#include <stdio.h>
#include <string.h>

int main()
{
	char str[20];

	strcpy(str, "tire-bouchon");
	strcpy(&str[4], "d-or-wi");
	strcat(str, "red?");

	printf("%s\n", str);

	return 0;
}


================================================
FILE: codes/CProgramming/ch13_字符串/ex_11.c
================================================
/*
 * 在执行下列语句后,字符串s1与s2的值各是多少?
 *
 * strcpy(s1, "computer");
 * strcpy(s2, "science");
 * if (strcmp(s1, s2) < 0)
 * 	strcat(s1, s2);
 * else
 * 	strcat(s2, s1);
 * s2[strlen(s2)-6] = '\0';
 */

/*
 * s1: computerscience
 * s2: s
 */

#include <stdio.h>
#include <string.h>

int main()
{
	char s1[20], s2[20];

	strcpy(s1, "computer");
	strcpy(s2, "science");
	if (strcmp(s1, s2) < 0)
		strcat(s1, s2);
	else
		strcat(s2, s1);
	s2[strlen(s2)-6] = '\0';

	printf("s1: %s\n", s1);
	printf("s2: %s\n", s2);

	return 0;
}


================================================
FILE: codes/CProgramming/ch13_字符串/ex_12.md
================================================
下面的函数假设用来创建字符串的相同副本。请指出这个函数中的错误?

```c
char *strdup(const char *p)
{
	char *q;
	strcpy(q, p);
	return q;
}
```

---

q没有指向一个可用的字符数组,无法拷贝字符串。


================================================
FILE: codes/CProgramming/ch13_字符串/ex_13.c
================================================
/*
 * 在本章的末尾“问与答”小节说明了利用数组下标的方式来编写 strcmp 函数的方法。请用指针算术
 * 运算的方法来修改此函数。
 */

#include <stdio.h>

int strcmp_(char *s, char *t)
{
	while (*s == *t) {
		if (*s == '\0')
			return 0;

		s++;
		t++;
	}
	return *s - *t;
}

int main()
{
	printf("%d\n", strcmp_("Hello", "Hi"));
	printf("%d\n", strcmp_("Hi", "Hi"));
	printf("%d\n", strcmp_("Hi", "Hello"));

	return 0;
}


================================================
FILE: codes/CProgramming/ch13_字符串/ex_14.c
================================================
/*
 * 编写程序用来找到一组单词中“最大”单词和“最小”单词。当用户输入单词后,程序根据字典的排序
 * 决定排在最前面和最后面的单词。当用户输入了4个字母的单词时,程序必须停止读入。假设所有
 * 单词都不超过20个字母。程序与用户的交互显示如下所示:
 *
 * Enter word: dog
 * Enter word: zebra
 * Enter word: rabbit
 * Enter word: catfish
 * Enter word: walrus
 * Enter word: cat
 * Enter word: fish
 * Smallest word: cat
 * Largest word: zebra
 *
 * 提示:使用两个名为 smallest_word 和 largest_word 的字符串来记录当前输入“最小”单词和
 * “最大”单词。每次用户输入新单词,就用 strcmp 函数把它与 smallest_word 进行比较。如果
 * 新的单词比 smallest_word 小,就用 strcpy 函数把新单词保存到 smallest_word 中。用类似
 * 的方式与 largest_word 也进行比较。用 strlen 函数用来判断用户输入4个字符的单词的时候。
 */

#include <stdio.h>
#include <string.h>

#define LEN 20

int main()
{
	char smallest_word[LEN + 1];
	char largest_word[LEN + 1];
	char word[LEN + 1];

	printf("Enter word: ");
	scanf("%s", word);

	strcpy(smallest_word, word);
	strcpy(largest_word, word);

	while (strlen(word) != 4) {
		if (strcmp(smallest_word, word) > 0) strcpy(smallest_word, word);
		if (strcmp(largest_word, word) < 0) strcpy(largest_word, word);

		printf("Enter word: ");
		scanf("%s", word);
	}

	printf("Smallest word: %s\n", smallest_word);
	printf("Largest word: %s\n", largest_word);

	return 0;
}


================================================
FILE: codes/CProgramming/ch13_字符串/ex_15.c
================================================
/*
 * 按如下方式改进 remind.c 程序:
 *
 * (a) 如果对应的天为负数或大于31,那么先是显示出错误信息,然后忽略提示。提示:使用 continue 语句
 *
 * (b) 允许用户输入天、24小时格式的时间(可能空白)和提示。显示的提示列表必须先按天排序存储,然后
 * 再根据时间排序存储。(原始的 remind.c 程序允许用户输入时间,但是它把时间作为提示的一部分来处理)
 *
 * (c) 程序需显示一年的提示列表。要求用户按照月/日的格式输入日期。
 */

/*
 * remind.c
 *
 * Prints a one-month reminder list
 */

/*
 * Enter day and reminder: 09/27 10:56 Susan birthday
 */

#include <stdio.h>
#include <string.h>

#define MAX_REMIND 50
#define MSG_LEN 60

int read_line(char str[], int n);

int main()
{
	char reminders[MAX_REMIND][MSG_LEN + 3];
	char day_str[12], msg_str[MSG_LEN + 1];
	int day, month, hour, min, i, j, num_remind = 0;

	for (;;) {
		if (num_remind == MAX_REMIND) {
			printf("-- No space left --\n");
			break;
		}

		printf("Enter day and reminder: ");
		day = 0;
		scanf("%2d/%2d", &month, &day);
		if (day == 0) break;

		if (day < 0 || day > 31) {
			printf("Bad day, ignored\n");
			while (getchar() != '\n');
			continue;
		}

		scanf("%2d:%2d", &hour, &min);

		sprintf(day_str, "%.2d/%.2d %.2d:%.2d", month, day, hour, min);
		read_line(msg_str, MSG_LEN);

		for (i = 0; i < num_remind; i++)
			if (strcmp(day_str, reminders[i]) < 0)
				break;
		for (j = num_remind; j > i; j--)
			strcpy(reminders[j], reminders[j-1]);

		strcpy(reminders[i], day_str);
		strcat(reminders[i], msg_str);

		num_remind++;
	}

	printf("\nDay Reminder\n");
	for (i = 0; i < num_remind; i++)
		printf(" %s\n", reminders[i]);

	return 0;
}

int read_line(char str[], int n)
{
	char ch;
	int i = 0;

	while ((ch = getchar()) != '\n') {
		if (i < n)
			str[i++] = ch;
	}
	str[i] = '\0';
	return i;
}


================================================
FILE: codes/CProgramming/ch13_字符串/ex_16.c
================================================
/*
 * 利用13.6节的方法来精简 count_space 函数。特别是要用 while 循环替换for语句
 */

/*
 * 统计字符串中空格的数量
 */

#include <stdio.h>

int count_space(const char *s)
{
	int count = 0;
	while (*s)
		if (*s++ == ' ') count++;

	return count;
}

int main()
{
	printf("space: %d\n", count_space("Hello World !!"));

	return 0;
}


================================================
FILE: codes/CProgramming/ch13_字符串/ex_17.c
================================================
/*
 * 修改8.2节的 deal.c 程序,使它显示出牌的全名:
 *
 * Enter number of cards in hand: 5
 * Your hand:
 * Seven of clubs
 * Two of spades
 * Five of diamonds
 * Ace of spaded
 * Two of hearts
 *
 * 提示:用指向字符串的指针数组来替换数组 rank_code 和数组 suit_code;
 */

/* Deals a random hand of cards. */

#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <string.h>

#define NUM_SUITS 4
#define NUM_RANKS 13

int main()
{
	int inhand_cards[NUM_SUITS][NUM_RANKS];
	char* suit_list[NUM_SUITS] = {"clubs", "diamonds", "hearts", "spades"};
	char* rank_list[NUM_RANKS] = {"ACE", "TWO", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queue", "King"};
	int need_cards;
	int rank, suit;

	printf("Enter number of cards in hand: ");
	scanf("%d", &need_cards);

	printf("Your hand:\n");

	memset(inhand_cards, 0, sizeof(inhand_cards));

	srand((unsigned int)time(NULL));
	while (need_cards > 0)
	{
		suit = rand() % NUM_SUITS;
		rank = rand() % NUM_RANKS;
		if (inhand_cards[suit][rank] == 0)
		{
			inhand_cards[suit][rank] = 1;
			-- need_cards;

			printf("%s of %s\n", rank_list[rank], suit_list[suit]);
		}
	}
	return 0;
}


================================================
FILE: codes/CProgramming/ch13_字符串/ex_18.md
================================================
编写名为 reverse.c 的程序,用来把命令行参数按反序输出。如果按下述方式执行程序:

reverse void and null

产生的输出为:

null and void

---

见 [reverse.c](./reverse.c)


================================================
FILE: codes/CProgramming/ch13_字符串/ex_19.c
================================================
/*
 * 编写名为 sum.c 的程序,用来对命令行参数求和。假设参数都是整数。如果按下述方式执行程序:
 *
 * sum 8 24 62
 *
 * 产生的输出应为
 *
 * Total: 94
 *
 * 提示:用 atoi 函数把每个命令行参数从字符串格式转换为整数格式。
 */

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char* argv[])
{
	int sum;
	int i;

	for (i = 1; i < argc; i++)
		sum += atoi(argv[i]);

	printf("Total: %d\n", sum);

	return 0;
}


================================================
FILE: codes/CProgramming/ch13_字符串/ex_20.c
================================================
/*
 * 改进程序 planets.c ,使它在比较命令行参数与 planets 数组中的字符串时忽略大小写。
 */

/*
 * planet.c
 *
 * Checks planet names
 */

#include <stdio.h>
#include <string.h>
#include <ctype.h>

#define NUM_PLANETS 9

void ToUpper(const char* s, char *out)
{
	while (*s) {
		*out++ = toupper(*s++);
	}
}

int main(int argc, char *argv[])
{
	char *planets[] = {
		"Mercury",
		"Venus",
		"Earth",
		"Mars",
		"Jupiter",
		"Saturn",
		"Uranus",
		"Neptune",
		"Pluto",
	};

	int i, j;
	for (i = 1; i < argc; i++) {
		for (j = 0; j < NUM_PLANETS; j++) {
			char s1[20], s2[20];
			ToUpper(argv[i], s1);
			ToUpper(planets[j], s2);

			if (strcmp(s1, s2) == 0) {
				printf("%s is planet %d\n", argv[i], j + 1);
				break;
			}
		}

		if (j == NUM_PLANETS) {
			printf("%s is not a planet\n", argv[i]);
		}
	}

	return 0;
}


================================================
FILE: codes/CProgramming/ch13_字符串/planet.c
================================================
/*
 * planet.c
 *
 * Checks planet names
 */

#include <stdio.h>
#include <string.h>

#define NUM_PLANETS 9

int main(int argc, char *argv[])
{
	char *planets[] = {
		"Mercury",
		"Venus",
		"Earth",
		"Mars",
		"Jupiter",
		"Saturn",
		"Uranus",
		"Neptune",
		"Pluto",
	};

	int i, j;
	for (i = 1; i < argc; i++) {
		for (j = 0; j < NUM_PLANETS; j++) {
			if (strcmp(argv[i], planets[j]) == 0) {
				printf("%s is planet %d\n", argv[i], j + 1);
				break;
			}
		}

		if (j == NUM_PLANETS) {
			printf("%s is not a planet\n", argv[i]);
		}
	}

	return 0;
}


================================================
FILE: codes/CProgramming/ch13_字符串/read_line.c
================================================
/*
 * 读取一行字符串,返回读取的数量
 */

#include <stdio.h>

#define LEN 20

int read_line(char str[], int n)
{
	char ch;
	int i = 0;

	while ((ch = getchar()) != '\n') {
		if (i < n)
			str[i++] = ch;
	}
	str[i] = '\0';

	return i;
}

int main()
{
	char str[LEN + 1];
	int len;

	len = read_line(str, LEN);
	printf("read %d charactors: %s\n", len, str);

	return 0;
}


================================================
FILE: codes/CProgramming/ch13_字符串/remind.c
================================================
/*
 * remind.c
 *
 * Prints a one-month reminder list
 */

#include <stdio.h>
#include <string.h>

#define MAX_REMIND 50
#define MSG_LEN 60

int read_line(char str[], int n);

int main()
{
	char reminders[MAX_REMIND][MSG_LEN + 3];
	char day_str[3], msg_str[MSG_LEN + 1];
	int day, i, j, num_remind = 0;

	for (;;) {
		if (num_remind == MAX_REMIND) {
			printf("-- No space left --\n");
			break;
		}

		printf("Enter day and reminder: ");
		scanf("%2d", &day);
		if (day == 0) break;

		sprintf(day_str, "%2d", day);
		read_line(msg_str, MSG_LEN);

		for (i = 0; i < num_remind; i++)
			if (strcmp(day_str, reminders[i]) < 0)
				break;
		for (j = num_remind; j > i; j--)
			strcpy(reminders[j], reminders[j-1]);

		strcpy(reminders[i], day_str);
		strcat(reminders[i], msg_str);

		num_remind++;
	}

	printf("\nDay Reminder\n");
	for (i = 0; i < num_remind; i++)
		printf(" %s\n", reminders[i]);

	return 0;
}

int read_line(char str[], int n)
{
	char ch;
	int i = 0;

	while ((ch = getchar()) != '\n') {
		if (i < n)
			str[i++] = ch;
	}
	str[i] = '\0';
	return i;
}


================================================
FILE: codes/CProgramming/ch13_字符串/reverse.c
================================================
/*
 * 把命令行参数反序输出。如果按下述方式执行程序:
 *
 * reverse void and null
 *
 * 产生的输出应为
 *
 * null and void
 */

#include <stdio.h>

int main(int argc, char* argv[])
{
	int i;

	for (i = argc - 1; i >= 1; i--) {
		printf("%s ", argv[i]);
	}

	return 0;
}


================================================
FILE: codes/CProgramming/ch13_字符串/strcat.c
================================================
/*
 * strcat 实现
 */

#include <stdio.h>

char *strcat_(char *s1, const char *s2)
{
	char *p = s1;

	while (*p)
		p++;
	while ((*p++ = *s2++) != '\0');
	return s1;
}

int main()
{
	char str[20] = "Hello";

	printf("str: %s\n", strcat_(str, " World"));

	return 0;
}


================================================
FILE: codes/CProgramming/ch13_字符串/strcmp.c
================================================
/*
 * strcmp 的实现
 */

#include <stdio.h>

int strcmp_(char *s, char *t)
{
	int i;

	for (i = 0; s[i] == t[i]; i++)
		if (s[i] == '\0')
			return 0;
	return s[i] - t[i];
}

int main()
{
	printf("%d\n", strcmp_("Hello", "Hi"));
	printf("%d\n", strcmp_("Hi", "Hi"));
	printf("%d\n", strcmp_("Hi", "Hello"));

	return 0;
}


================================================
FILE: codes/CProgramming/ch13_字符串/strlen.c
================================================
/*
 * strlen 的实现
 */

#include <stdio.h>

size_t strlen_(const char *s)
{
	const char *p = s;

	while (*s)
		s++;
	return s - p;
}

int main()
{
	char str[] = "Hello world";

	printf("len of str(%s) is: %d\n", str, (int)strlen_(str));

	return 0;
}


================================================
FILE: codes/CProgramming/ch14_预处理器/build.sh
================================================
#! /bin/bash

# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]

all_c_files=`ls *.c`
exclude_files="ex_12.c"

is_exclude_file() {
	for file in $exclude_files; do
		if [ "$file" = "$1" ]; then
			return 0
		fi
	done

	return 1
}

main() {
	for c_file in $all_c_files; do
		exe_file=${c_file%%.c*}.exe

		if [ "$1" == "clear" ]; then
			rm -f $exe_file
			continue
		fi

		if is_exclude_file $c_file; then
			continue
		fi

		if [ $exe_file -nt $c_file ] && [ "$1" != "rebuild" ]; then
			continue
		fi

		echo "[BUILDING] $c_file -> $exe_file"
		gcc -g -Wall $c_file -o $exe_file

		if [ "$?" != "0" ]; then
			return 1
		fi
	done

	return 0
}

main $1

exit $?


================================================
FILE: codes/CProgramming/ch14_预处理器/ex_01.c
================================================
/*
 * 编写宏来计算下面的值。
 * (a) x的立方。
 * (b) x除以4的余数。
 * (c) 如果x与y的乘积小于100值为1,否则值为0。
 */

#include <stdio.h>

#define EX_A(x) ((x)*(x)*(x))
#define EX_B(x) ((x) % 4)
#define EX_C(x, y) ((x) * (y) < 100 ? 1 : 0)

int main()
{
	int x = 10;
	int y = 20;

	printf("%d\n", EX_A(x));
	printf("%d\n", EX_B(x));
	printf("%d\n", EX_C(x, y));

	return 0;
}


================================================
FILE: codes/CProgramming/ch14_预处理器/ex_02.c
================================================
/*
 * 编写一个宏 NELEMS(a) 来计算一个一维数组a中元素的个数。提示:使用 sizeof 运算符。
 */

#include <stdio.h>

#define NELEMS(a) ((int)(sizeof(a)/sizeof(a[0])))

int main()
{
	char str[] = "Hello World";

	printf("real len of str: %d\n", NELEMS(str));

	return 0;
}


================================================
FILE: codes/CProgramming/ch14_预处理器/ex_03.c
================================================
/*
 * 假定 DOUBLE 是如下宏:
 *
 * #define DOUBLE(x) 2*x
 *
 * (a) DOUBLE(1+2) 的值是多少?
 * (b) 4/DOUBLE(2) 的值是多少?
 * (c) 改正 DOUBLE 的定义
 */

/*
 * (a) 4
 * (b) 4
 */

#include <stdio.h>

#define DOUBLE(x) 2*x
#define DOUBLE_FIX(x) (2*(x))

int main()
{
	printf("%d\n", DOUBLE(1+2));
	printf("%d\n", 4/DOUBLE(2));

	printf("%d\n", DOUBLE_FIX(1+2));
	printf("%d\n", 4/DOUBLE_FIX(2));

	return 0;
}


================================================
FILE: codes/CProgramming/ch14_预处理器/ex_04.c
================================================
/*
 * 针对下面每一个宏,举例说明宏的问题,并提出修改方法。
 *
 * (a) #define AVG(x,y) (x+y)/2
 * (b) #define AREA(x,y) (x) * (y)
 */

#include <stdio.h>

#define AVG(x,y) (x+y)/2
#define AREA(x,y) (x) * (y)

#define AVG_FIX(x, y) (((x) + (y))/2)
#define AREA_FIX(x, y) ((x) * (y))

int main()
{
	int res;
	double d_res;

	res = AVG(4 || 1, 10); // 期望为1和10的平均值,但实际上计算了1/2
	printf("res: %d\n", res);

	res = AVG_FIX(4 || 1, 10);
	printf("res: %d\n", res);

	d_res = (int)AREA(3, 1.5);	// 期望为4,但实际上还是4.5
	printf("d_res: %g\n", d_res);

	d_res = (int)AREA_FIX(3, 1.5);
	printf("d_res: %g\n", d_res);

	return 0;
}


================================================
FILE: codes/CProgramming/ch14_预处理器/ex_05.c
================================================
/*
 * 下面的宏定义有问题:
 *
 * #define ABS(a) ((a)<0?-(a):a)
 *
 * 举例说明为什么 ABS 不能正常工作,并提出修改方法。你可以假定 ABS 的参数没有副作用。
 */

/*
 * PS,尚未找到不能工作的例子。
 */

#include <stdio.h>

#define ABS(a) ((a)<0?-(a):a)
#define ABS_FIX(a) ((a)<0?-(a):(a)) /* 应当给最后的一个a加上括号 */

int main()
{

	return 0;
}


================================================
FILE: codes/CProgramming/ch14_预处理器/ex_06.c
================================================
/*
 * 假定 TOUPPER 定义成下面的宏:
 *
 * #define TOUPPER(c) ('a'<=(c)&&(c)<='z'?(c)-'a'+'A':(c))
 *
 * 假设s是一个字符串,i是一个 int 型变量。给出下面每个代码段所产生的输出。
 *
 * (a) strcpy(s, "abcd");
 * i = 0;
 * putchar(TOUPPER(s[++i]));
 *
 * (b) strcpy(s, "0123");
 * i = 0;
 * putchar(TOUPPER(s[++i]));
 */

/*
 * (a) D
 * (b) 2
 *
 * PS: 在参数列表里使用++,使得宏有副作用
 */

#include <stdio.h>
#include <string.h>

#define TOUPPER(c) ('a'<=(c)&&(c)<='z'?(c)-'a'+'A':(c))

int main()
{
	int i;
	char s[20];

	/* a */
	strcpy(s, "abcd");
	i = 0;
	putchar(TOUPPER(s[++i]));

	/* b */
	strcpy(s, "0123");
	i = 0;
	putchar(TOUPPER(s[++i]));

	return 0;
}


================================================
FILE: codes/CProgramming/ch14_预处理器/ex_07.c
================================================
/*
 * (a) 编写宏 DISP(f, x) ,使其扩展后调用 printf 函数来显示函数f的参数为x时的值。例如:
 *
 * DISP(sqrt, 3.0);
 *
 * 应该扩展为:
 *
 * printf("sqrt(%g) = %g\n", 3.0, sqrt(3.0));
 *
 * (b) 编写宏 DISP2(f, x, y) ,类似 DISP 但应用于有两个参数的函数。
 */

#include <stdio.h>
#include <math.h>

#define DISP(f, x) (printf(#f "(%g) = %g\n", (x), (f)(x)))

#define DISP2(f, x, y) (printf(#f "(%g, %g) = %g\n", (x), (y), (f)(x, y)))

double sum(double a, double b)
{
	return a + b;
}

int main()
{
	DISP(sqrt, 3.0);
	DISP2(sum, 3.5, 4.3);

	return 0;
}


================================================
FILE: codes/CProgramming/ch14_预处理器/ex_08.c
================================================
/*
 * 假定 GENERIC_MAX 是如下宏:
 *
 * #define GENERIC_MAX(type)\
 * type type##_max(type x, type y)\
 * {\
 * 	return x > y ? x : y;\
 * }
 *
 * (a) 写出 GENERIC_MAX(long) 被预处理器扩展后的形式
 * (b) 解释为什么 GENERIC_MAX 不能应用在像 unsigned long 这样的基本类型上?
 * (c) 如何使 GENERIC_MAX 对任何基本类型都可以正常工作?提示:不要改变 GENERIC_MAX 的定义。
 */

/*
 * (a)
 * long long_max(long x, long y)
 * {
 * 	return x > y ? x : y;
 * }
 *
 * (b) 因为 unsigned long 有一个空格,没办法用 ## 连接成一个合法的函数名
 *
 * (c) 可以使用类型别名,如下
 */

#include <stdio.h>

#define GENERIC_MAX(type)\
type type##_max(type x, type y)\
{\
	return x > y ? x : y;\
}

typedef unsigned long UIntLong;

GENERIC_MAX(UIntLong);

int main()
{
	printf("%ld\n", UIntLong_max(10, 42));

	return 0;
}


================================================
FILE: codes/CProgramming/ch14_预处理器/ex_09.c
================================================
/*
 * 如果需要一个宏,使它展开后包含当前行号和文件名。换而言之,我们会写:
 * const char *str = LINE_FILE;
 * 扩展后为
 * const char *str = "Line 10 of file foo.c";
 *
 * 其中 foo.c 是包含程序的文件,10是调用 LINE_FILE 行的行号。
 */

#include <stdio.h>

#define LINE_FILE line_file(__LINE__)

const char *line_file(int line)
{
	static char buff[100];

	sprintf(buff, "Line %d of file %s", line, __FILE__);
	return buff;
}

int main()
{
	const char *str = LINE_FILE;
	printf("%s\n", str);

	return 0;
}


================================================
FILE: codes/CProgramming/ch14_预处理器/ex_10.c
================================================
/*
 * 假定宏M有如下定义:
 * #define M 10
 *
 * 下面那项测试会失败?
 * (a) #if M
 * (b) #ifdef M
 * (c) #ifndef M
 * (d) #if defined(M)
 * (e) #if !defined(M)
 */

/*
 * (c) (e)
 */

#include <stdio.h>

#define M 10

int main()
{
	#if M
	printf("(a)\n");
	#endif

	#ifdef M
	printf("(b)\n");
	#endif

	#ifndef M
	printf("(c)\n");
	#endif

	#if defined(M)
	printf("(d)\n");
	#endif

	#if !defined(M)
	printf("(e)\n");
	#endif

	return 0;
}


================================================
FILE: codes/CProgramming/ch14_预处理器/ex_11.c
================================================
/*
 * (a) 指出下面的程序预处理后的形式。
 *
 * #define N 10
 *
 * void f(void);
 *
 * main()
 * {
 * 	f();
 * 	#ifdef N
 * 	#undef N
 * 	#endif
 * 	return 0;
 * }
 *
 * void f(void)
 * {
 * #if defined(N)
 * 	printf("N is %d\n", N);
 * #else
 * 	printf("N is undefined\n");
 * #endif
 * }
 *
 * (b) 这个程序的输出是什么?
 */

/*
 * 预处理后为:
 *
 * void f(void)
 * {
 * 	printf("N is undefined\n");
 * }
 *
 * 输出为:
 *
 * N is undefined
 */

#include <stdio.h>

#define N 10
void f(void);
int main()
{
	f();
	#ifdef N
	#undef N
	#endif
	return 0;
}

void f(void)
{
#if defined(N)
printf("N is %d\n", N);
#else
printf("N is undefined\n");
#endif
}


================================================
FILE: codes/CProgramming/ch14_预处理器/ex_12.c
================================================
/*
 * 指出下面的程序预处理后的形式。其中有几行可能会导致编译错误,请找出这些错误。
 *
 * #define N = 10
 * #define INC(x) x+1
 * #define SUB(x,y) x - y
 * #define SQR(x) ((x)*(x))
 * #define CUBE(x) (SQR(x)*(x))
 * #define M1(x,y) x##y
 * #define M2(x,y) #x #y
 *
 * main()
 * {
 * 	int a[N], i, j, k, m;
 * 	#ifdef N
 * 	i = j;
 * 	#else
 * 	j = i;
 * 	#endif
 * 	i = 10 * INC(j);
 * 	i = SUB(j, k);
 * 	i = SQR(SQR(j++));
 * 	i = CUBE(j);
 * 	i = M1(j, k);
 * 	puts(M2(i, j));
 * 	#undef SQR
 * 	i = SQR(j);
 * 	#define SQR
 * 	i = SQR(j);
 * 	return 0;
 * }
 */

#include <stdio.h>

#define N = 10
#define INC(x) x+1
#define SUB(x,y) x - y
#define SQR(x) ((x)*(x))
#define CUBE(x) (SQR(x)*(x))
#define M1(x,y) x##y
#define M2(x,y) #x #y

int main()
{
	int a[=10], i, j, k, m; /* 编译错误 */
	i = j;
	i = 10 * j+1;
	i = j - k;
	i = ((((j++)*(j++)))*(((j++)*(j++))));
	i = (((j)*(j))*(j));
	i = jk;	/* 编译错误 */
	puts("i" "j");
	i = SQR(j); /* 编译错误 */
	i =; /* 编译错误 */

	return 0;
}


================================================
FILE: codes/CProgramming/ch15_编写大规模程序/build.sh
================================================
#! /bin/bash

# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]

all_c_files=`ls *.c`
exclude_files=""

is_exclude_file() {
	for file in $exclude_files; do
		if [ "$file" = "$1" ]; then
			return 0
		fi
	done

	return 1
}

main() {
	for c_file in $all_c_files; do
		exe_file=${c_file%%.c*}.exe

		if [ "$1" == "clear" ]; then
			rm -f $exe_file
			continue
		fi

		if is_exclude_file $c_file; then
			continue
		fi

		if [ $exe_file -nt $c_file ] && [ "$1" != "rebuild" ]; then
			continue
		fi

		echo "[BUILDING] $c_file -> $exe_file"
		gcc -g -Wall $c_file -o $exe_file

		if [ "$?" != "0" ]; then
			return 1
		fi
	done

	return 0
}

main $1

exit $?


================================================
FILE: codes/CProgramming/ch15_编写大规模程序/dir_ex_04/bar.c
================================================
/*
 * bar.c
 */

#include <stdio.h>

extern long int i;

extern int Get();
extern int GetAddress();

int main()
{
	i = 0;

	printf("i: %ld\n", i);
	printf("i from foo: %i\n", Get());

	printf("address of i: %p\n", &i);
	printf("address of i from foo: %p\n", GetAddress());

	return 0;
}


================================================
FILE: codes/CProgramming/ch15_编写大规模程序/dir_ex_04/foo.c
================================================
/*
 * foo.c
 */

int i = 100000;

int Get()
{
	return i;
}

int* GetAddress()
{
	return &i;
}


================================================
FILE: codes/CProgramming/ch15_编写大规模程序/dir_ex_04/makefile
================================================
main: bar.o foo.o
	gcc -o main bar.o foo.o

bar.o: bar.c
foo.o: foo.c

clean:
	@rm -f main *.o


================================================
FILE: codes/CProgramming/ch15_编写大规模程序/dir_ex_06/main.c
================================================
#include <stdio.h>
#include <stdlib.h>

#include "stack.h"
#include "token.h"

/*
    获取逆波兰表达式的值,输入#或EOF结束表达式:
    30 5 - 7 * #

    结果等于 (30 - 5) * 7 = 175
*/

int main()
{
    TokenType token_type;
    int n1, n2;
    int result;

    while (1)
    {
        token_type = next_token();
        if (token_type == TYPE_END)
        {
            break;
        }
        else if (token_type == TYPE_NUMBER)
        {
            stack_push(get_last_number());
        }
        else if (token_type == TYPE_OP)
        {
            n1 = stack_pop();
            n2 = stack_pop();
            switch(get_last_op())
            {
                case '+': result = n2 + n1;
                break;

                case '-': result = n2 - n1;
                break;

                case '*': result = n2 * n1;
                break;

                case '\\': result = n2 / n1;
                break;
            }
            stack_push(result);
        }
    }

    printf("result: %d\n", stack_pop());

    return 0;
}

================================================
FILE: codes/CProgramming/ch15_编写大规模程序/dir_ex_06/makefile
================================================
CC=gcc

main: main.o stack.o token.o
	gcc -g -Wall -o main main.o stack.o token.o

main.o: main.c stack.h token.h
stack.o: stack.c stack.h
token.o: token.c token.h

clean:
	@rm -f main *.o *.exe


================================================
FILE: codes/CProgramming/ch15_编写大规模程序/dir_ex_06/stack.c
================================================
#include "stack.h"
#include <assert.h>

#define STACK_SIZE 100

/* external variables */
int contents[STACK_SIZE];
int top = 0;

void stack_make_empty()
{
	top = 0;
}

int stack_is_empty()
{
	return 0 == top;
}

PRIVATE int stack_is_full()
{
	return STACK_SIZE == top;
}

void stack_push(int i)
{
	assert(!stack_is_full());
	
	contents[top ++] = i;
}

int stack_pop()
{
	assert(!stack_is_empty());

	return contents[-- top];
}

================================================
FILE: codes/CProgramming/ch15_编写大规模程序/dir_ex_06/stack.h
================================================
#ifndef STACK_H
#define STACK_H

#define PUBLIC /* empty */
#define PRIVATE static

PUBLIC void stack_make_empty();
PUBLIC int stack_is_empty();
PUBLIC void stack_push();
PUBLIC int stack_pop();

#endif // STACK_H

================================================
FILE: codes/CProgramming/ch15_编写大规模程序/dir_ex_06/token.c
================================================
#include "token.h"
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>

static int last_number;
static char last_op;

int get_last_number()
{
    return last_number;
}

char get_last_op()
{
    return last_op;
}

TokenType next_token()
{
    char c;
    int number_str_index = 0;
    char number_str[100];
    while (1)
    {
        c = getchar();
        if (c == ' ' || c == '\n') break;
        if (c == '#' || c == EOF) break;

        if (c == '+' || c== '-' || c == '*' || c == '\\')
        {
            last_op = c;
            return TYPE_OP;
        }

        if (isdigit(c))
        {
            number_str[number_str_index++] = c;
        }
    }

    if (number_str_index > 0)
    {
        number_str[number_str_index] = '\0';
        last_number = atoi(number_str);
        return TYPE_NUMBER;
    }

    if (c == '#' || c == EOF)
    {
        return TYPE_END;
    }
    else
    {
        return TYPE_CONTINUE;
    }
}

================================================
FILE: codes/CProgramming/ch15_编写大规模程序/dir_ex_06/token.h
================================================
#ifndef TOKEN_H
#define TOKEN_H

#define TYPE_NUMBER 0
#define TYPE_OP 1
#define TYPE_END 2
#define TYPE_CONTINUE 3

typedef int TokenType;

TokenType next_token();
int get_last_number();
char get_last_op();

#endif // TOKEN_H

================================================
FILE: codes/CProgramming/ch15_编写大规模程序/dir_ex_07/f1.c
================================================
#include "f1.h"
#include "f2.h"

================================================
FILE: codes/CProgramming/ch15_编写大规模程序/dir_ex_07/f1.h
================================================
#ifndef F1_H
#define F1_H

#endif // F1_h

================================================
FILE: codes/CProgramming/ch15_编写大规模程序/dir_ex_07/f2.c
================================================
#include "f1.h"
#include "f2.h"

================================================
FILE: codes/CProgramming/ch15_编写大规模程序/dir_ex_07/f2.h
================================================
#ifndef F2_H
#define F2_H

#endif // F2_H

================================================
FILE: codes/CProgramming/ch15_编写大规模程序/dir_ex_07/main.c
================================================
#include "f1.h"

int main()
{
    return 0;
}

================================================
FILE: codes/CProgramming/ch15_编写大规模程序/dir_ex_07/makefile
================================================
CC=gcc

demo: main.o f1.o f2.o
	$(CC) -o demo main.o f1.o f2.o

f1.o: f1.c f1.h f2.h
f2.o: f2.c f1.h f2.h
main.o: main.c f1.h

clean:
	@rm -f *.o *.exe main

================================================
FILE: codes/CProgramming/ch15_编写大规模程序/ex_01.md
================================================
15.1节列出了把程序分割成多个源程序的几个优点。

(a) 请描述几个其他的优点。

(b) 请描述一些缺点。

---

(a) 方便多人协同开发程序,不同的人负责不同的模块(文件)。可以将源程序编译为库,而不是可执行程序,库可以重复利用。方便制定模块的接口,预先定义而不具体实现,从而快速搭建整体程序逻辑。

(b) 构建相对复杂。理解程序需要分别理解各个模块,甚至依赖相关文档,不适合微型程序。


================================================
FILE: codes/CProgramming/ch15_编写大规模程序/ex_02.md
================================================
下列哪个不应该放置在头文件中?为什么?

(a) 函数原型。

(b) 函数定义。

(c) 宏定义。

(d) 类型定义。

---

(b) 不应该,为了避免重复的函数定义。


================================================
FILE: codes/CProgramming/ch15_编写大规模程序/ex_03.md
================================================
如果文件是我们已经编写好的,那么已经看到用`#include <文件>`代替`#include "文件"`可能无法工作。如果文件是系统头文件,那么用`#include "文件"`代替`#include <文件>`是否有什么问题?

---

可能会在程序自己的目录找到一个同名的文件,从而未能正确使用系统的头文件。


================================================
FILE: codes/CProgramming/ch15_编写大规模程序/ex_04.md
================================================
假设文件foo.c定义了外部变量i如下:

int i;

而且文件bar.c以下列方式声明此变量:

extern long int i;

(a) 假设sizeof(int)和sizeof(long int)是完全一样的。如果文件bar.c中的一个函数给i赋值为0,请解释会发生什么?

(b) 假设sizeof(int)小于sizeof(long int)。请重复(1)的问题。

---

(a) 两个i实质上是一个存储位置,因此会把foo.c中的i也变成0。

(b) 会修改foo.c中的变量,但类型不一致,导致访问时取得的值不一致。

见 [测试程序](./dir_ex_04)


================================================
FILE: codes/CProgramming/ch15_编写大规模程序/ex_05.md
================================================
程序fmt通过在单词间插入额外的空格来调整行。当前编写的函数 writen_line 的方法是,与开始处的单词间隔相比,靠近行末尾单词的间隔略宽一些。(例如,靠近末尾的单词彼此之间可能有3个空格,而靠近开始的单词彼此之间可能只有两个空格。)请通过替换函数 write_line 来改进此程序,替换后的函数可以在靠近行末尾处的单词之间放置较大的空隙,而在行开始处的单词之间放置一般空隙。

---

见 [line.c中的write_line_ex5函数](./format_program/line.c)


================================================
FILE: codes/CProgramming/ch15_编写大规模程序/ex_06.md
================================================
利用15.2节中的设计,编写实现逆波兰表达式计算器的程序。使计算机可以实现双目运算+、-、*和/。假设它们的含义和在C语言中一样。

见[测试程序](./dir_ex_06)

================================================
FILE: codes/CProgramming/ch15_编写大规模程序/ex_07.md
================================================
假设程序有3个源文件构成:main.c、f1.c和f2.c,此外还包括l两个头文件f1.h和f2.h。全部3个源文件都包含f1.h,但是只有f1.c和f2.c包含f2.h。为此程序编写UNIX makefile。假设需要可执行文件名未为demo。

见[程序](./dir_ex_07)

================================================
FILE: codes/CProgramming/ch15_编写大规模程序/ex_08.md
================================================
下面的问题引用了练习7的描述。

(a) 当程序第一次构建时,需要对哪些文件进行编译?

(b) 如果在程序构建后对f1.c进行修改,那么需要对哪个(些)文件进行重新编译?

(c) 如果在程序构建后对f1.h进行修改,那么需要对哪个(些)文件进行重新编译?

(d) 如果在程序构建后对f2.h进行修改,那么需要对哪个(些)文件进行重新编译?

---

(a) main.c f1.c f2.c

(b) f1.c

(c) main.c f1.c f2.c

(d) f1.c f2.c

================================================
FILE: codes/CProgramming/ch15_编写大规模程序/ex_09.md
================================================
(a) 修改程序 fmt ,使函数 read_word (代替 main 函数)在被截短的单词末尾存储\*字符。

(b) 如果按照(a)进行了修改,那么需要对哪个(些)文件进行重新编译?

---

(a) 见[程序](./format_program/word.c)中的 read_word_ex09 函数。

(b) main.c word.c

================================================
FILE: codes/CProgramming/ch15_编写大规模程序/format_program/fmt.c
================================================
/* Formats a file of text */

#include <string.h>
#include "line.h"
#include "word.h"

int main()
{
	char word[MAX_WORD_LEN + 2];
	int word_len;

	clear_line();

	/*
	for (;;) {
		read_word(word, MAX_WORD_LEN + 1);
		word_len = strlen(word);
		if (word_len == 0) {
			flush_line();
			return 0;
		}

		if (word_len > MAX_WORD_LEN)
			word[MAX_WORD_LEN] = '*';

		if (word_len + 1 > space_remaining()) {
			//write_line();
			write_line_ex5();
			clear_line();
		}
		add_word(word);
	}
	*/

	/*
		for ex_09
	*/
	for (;;) {
		read_word_ex09(word, MAX_WORD_LEN + 1);
		word_len = strlen(word);
		if (word_len == 0) {
			flush_line();
			return 0;
		}

		if (word_len + 1 > space_remaining()) {
			//write_line();
			write_line_ex5();
			clear_line();
		}
		add_word(word);
	}

	return 0;
}


================================================
FILE: codes/CProgramming/ch15_编写大规模程序/format_program/line.c
================================================
#include <stdio.h>
#include <string.h>
#include "line.h"

#define MAX_LINE_LEN 60

char line[MAX_LINE_LEN + 1];
int line_len = 0;
int num_words = 0;

void clear_line(void)
{
	line[0] = '\0';
	line_len = 0;
	num_words = 0;
}

void add_word(const char *word)
{
	if (num_words > 0) {
		line[line_len] = ' ';
		line[line_len+1] = '\0';
		line_len++;
	}

	strcat(line, word);
	line_len += strlen(word);
	num_words++;
}

int space_remaining(void)
{
	return MAX_LINE_LEN - line_len;
}

void write_line(void)
{
	int extra_spaces, spaces_to_insert, i, j;

	extra_spaces = MAX_LINE_LEN - line_len;
	for (i = 0; i < line_len; i++) {
		if (line[i] != ' ')
			putchar(line[i]);
		else {
			spaces_to_insert = extra_spaces / (num_words - 1);
			for (j = 1; j <= spaces_to_insert + 1; j++)
				putchar(' ');
			extra_spaces -= spaces_to_insert;
			num_words--;
		}
	}

	putchar('\n');
}

// 练习5:在靠近末尾处的的单词之间放置较大的空隙 ,在行开始处的单词之间放置一般空隙
void write_line_ex5(void)
{
	int extra_spaces, i, j;
	extra_spaces = MAX_LINE_LEN - line_len;
	for (i = 0; i < line_len; i++) {
		if (line[i] != ' ')
			putchar(line[i]);
		else {
			if (num_words != 2) {
				putchar(' ');
			}
			else {
				for (j = 1; j < extra_spaces + 1; j++)
					putchar(' ');
			}
			num_words--;
		}
	}

	putchar('\n');
}

void flush_line(void)
{
	if (line_len > 0)
		puts(line);
}


================================================
FILE: codes/CProgramming/ch15_编写大规模程序/format_program/line.h
================================================
#ifndef LINE_H
#define LINE_H

/*
 * clear_line: Clears the current line.
 */
void clear_line(void);

/*
 * add_word: Adds word to the end of the current line.
 *           If this is not the first word on the line,
 *           puts one space before word.
 */
void add_word(const char *word);

/*
 * space_remaining: Returns the number of characters left
 *                  in the current line.
 */
int space_remaining(void);

/*
 * write_line: Writes the current line with justification
 */
void write_line(void);

/*
 * flush_line: Writes the current line without justification.
 *             If the line is empty, does nothing.
 */
void flush_line(void);

/*
 * 练习5改写的 write_line ,要求靠近末尾处的的单词之间放置较大的空隙 ,在行开始处的单词之间放置一般空隙
 */
void write_line_ex5(void);

#endif


================================================
FILE: codes/CProgramming/ch15_编写大规模程序/format_program/makefile
================================================
format: fmt.o word.o line.o
	gcc -o format fmt.o word.o line.o

fmt.o: fmt.c line.h word.h
	gcc -c fmt.c

line.o: line.c line.h
	gcc -c line.c

word.o: word.c word.h
	gcc -c word.c

clean:
	rm -f *.o format*


================================================
FILE: codes/CProgramming/ch15_编写大规模程序/format_program/quote
================================================
C	is quirky,    floawed,    and an
enormous success.		while accidents of    history
 surely   helped,   it evidently	satisfied   a   need
 		for a    system   implementation	language   efficient
  enough to		displace			assembly   language,
     yet sufficiently    abstract	and fluent 	to describe
	algorithms	and		  interactions    int a wide	variety
of 	  environments. 
						-- Dennis 	M.			Ritchie
			varylongwordddddddddddddddddddddd


================================================
FILE: codes/CProgramming/ch15_编写大规模程序/format_program/word.c
================================================
#include <stdio.h>
#include <string.h>
#include "word.h"

int read_char(void)
{
	int ch = getchar();

	if (ch == '\n' || ch == '\t')
		return ' ';
	return ch;
}

void read_word(char *word, int len)
{
	int ch, pos = 0;
	while ((ch = read_char()) == ' ');

	while (ch != ' ' && ch != EOF) {
		if (pos < len)
			word[pos++] = ch;
		ch = read_char();
	}

	word[pos] = '\0';
}

void read_word_ex09(char *word, int len)
{
	int ch, pos = 0;
	int word_len;
	while ((ch = read_char()) == ' ');

	while (ch != ' ' && ch != EOF) {
		if (pos < len)
			word[pos++] = ch;
		ch = read_char();
	}
	
	word[pos] = '\0';

	word_len = strlen(word);
	if (word_len > MAX_WORD_LEN)
			word[MAX_WORD_LEN] = '*';
}

================================================
FILE: codes/CProgramming/ch15_编写大规模程序/format_program/word.h
================================================
#ifndef WORD_H
#define WORD_H

#define MAX_WORD_LEN 20

/*
 * read_word: Reads the next word from the input and
 * 			  stores it in word. Makes word empty if no
 * 			  word could be read because of end-of-file.
 * 			  Truncates the word if its length exceeds len.
 * 
 */
void read_word(char *word, int len);

/*
 * for ex_09
 */
void read_word_ex09(char *word, int len);

#endif


================================================
FILE: codes/CProgramming/ch15_编写大规模程序/format_program/核心伪代码.txt
================================================
for (;;) {
	读单词;
	if (不能读单词){
		不用调整地写行缓冲区的内容;
		终止程序;
	}

	if (单词不适合在行缓冲区中) {
		调整地写行缓冲区的内容;
		清除
Download .txt
gitextract_nd2mxzgw/

├── .gitignore
├── auto_refresh_mkdocs_site.sh
├── codes/
│   ├── CProgramming/
│   │   ├── README.md
│   │   ├── ch02_C语言基本概念/
│   │   │   ├── build.sh
│   │   │   ├── celsius.c
│   │   │   ├── dweight.c
│   │   │   ├── dweight2.c
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.c
│   │   │   ├── ex_09.md
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.md
│   │   │   ├── ex_12.md
│   │   │   ├── ex_13.md
│   │   │   └── pun.c
│   │   ├── ch03_格式化的输入输出/
│   │   │   ├── addfrac.c
│   │   │   ├── build.sh
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.c
│   │   │   ├── example_escape_sequence.c
│   │   │   ├── example_scanf.c
│   │   │   ├── stocks.c
│   │   │   └── tprintf.c
│   │   ├── ch04_表达式/
│   │   │   ├── build.sh
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.c
│   │   │   ├── ex_09.md
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.md
│   │   │   └── upc.c
│   │   ├── ch05_选择语句/
│   │   │   ├── broker.c
│   │   │   ├── build.sh
│   │   │   ├── date.c
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.c
│   │   │   ├── ex_09.c
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.c
│   │   │   ├── ex_12.c
│   │   │   ├── ex_13.c
│   │   │   ├── ex_14.c
│   │   │   ├── ex_15.c
│   │   │   └── ex_16.c
│   │   ├── ch06_循环/
│   │   │   ├── build.sh
│   │   │   ├── checking.c
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.c
│   │   │   ├── ex_09.c
│   │   │   ├── ex_10.md
│   │   │   ├── ex_11.md
│   │   │   ├── ex_12.c
│   │   │   ├── ex_13.c
│   │   │   ├── ex_14.c
│   │   │   ├── ex_15.c
│   │   │   ├── ex_16.md
│   │   │   ├── example_goto.c
│   │   │   ├── numdigit.c
│   │   │   ├── square.c
│   │   │   ├── square2.c
│   │   │   ├── square3.c
│   │   │   └── sum.c
│   │   ├── ch07_基本类型/
│   │   │   ├── build.sh
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.md
│   │   │   ├── ex_08.c
│   │   │   ├── ex_09.c
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.c
│   │   │   ├── ex_12.c
│   │   │   ├── ex_13.md
│   │   │   ├── ex_15.md
│   │   │   ├── ex_16.md
│   │   │   ├── ex_17.c
│   │   │   ├── ex_18.md
│   │   │   ├── ex_19.c
│   │   │   ├── length.c
│   │   │   ├── mytoupper.c
│   │   │   ├── scanf_char.c
│   │   │   ├── sum2.c
│   │   │   └── typedef_sizeof.c
│   │   ├── ch08_数组/
│   │   │   ├── build.sh
│   │   │   ├── deal.c
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.md
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.md
│   │   │   ├── ex_09.c
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.c
│   │   │   ├── ex_12.c
│   │   │   ├── ex_13.c
│   │   │   ├── interest.c
│   │   │   ├── repdigit.c
│   │   │   └── reverse.c
│   │   ├── ch09_函数/
│   │   │   ├── average.c
│   │   │   ├── build.sh
│   │   │   ├── countdown.c
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.md
│   │   │   ├── ex_09.c
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.md
│   │   │   ├── ex_12.c
│   │   │   ├── ex_13.c
│   │   │   ├── ex_14.c
│   │   │   ├── ex_15.c
│   │   │   ├── ex_16.c
│   │   │   ├── ex_17.c
│   │   │   ├── prime.c
│   │   │   ├── pun2.c
│   │   │   └── qsort.c
│   │   ├── ch10_程序结构/
│   │   │   ├── build.sh
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.md
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── guess.c
│   │   │   ├── poker.c
│   │   │   └── stack.c
│   │   ├── ch11_指针/
│   │   │   ├── build.sh
│   │   │   ├── ex_01.md
│   │   │   ├── ex_02.md
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   └── maxmin.c
│   │   ├── ch12_指针和数组/
│   │   │   ├── build.sh
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.md
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.md
│   │   │   ├── ex_08.md
│   │   │   ├── ex_09.md
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.c
│   │   │   ├── ex_12.c
│   │   │   ├── ex_13.c
│   │   │   ├── ex_14.c
│   │   │   ├── ex_15.c
│   │   │   └── reverse2.c
│   │   ├── ch13_字符串/
│   │   │   ├── build.sh
│   │   │   ├── count_space.c
│   │   │   ├── ex_01.md
│   │   │   ├── ex_02.md
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.c
│   │   │   ├── ex_09.md
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.c
│   │   │   ├── ex_12.md
│   │   │   ├── ex_13.c
│   │   │   ├── ex_14.c
│   │   │   ├── ex_15.c
│   │   │   ├── ex_16.c
│   │   │   ├── ex_17.c
│   │   │   ├── ex_18.md
│   │   │   ├── ex_19.c
│   │   │   ├── ex_20.c
│   │   │   ├── planet.c
│   │   │   ├── read_line.c
│   │   │   ├── remind.c
│   │   │   ├── reverse.c
│   │   │   ├── strcat.c
│   │   │   ├── strcmp.c
│   │   │   └── strlen.c
│   │   ├── ch14_预处理器/
│   │   │   ├── build.sh
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.c
│   │   │   ├── ex_09.c
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.c
│   │   │   └── ex_12.c
│   │   ├── ch15_编写大规模程序/
│   │   │   ├── build.sh
│   │   │   ├── dir_ex_04/
│   │   │   │   ├── bar.c
│   │   │   │   ├── foo.c
│   │   │   │   └── makefile
│   │   │   ├── dir_ex_06/
│   │   │   │   ├── main.c
│   │   │   │   ├── makefile
│   │   │   │   ├── stack.c
│   │   │   │   ├── stack.h
│   │   │   │   ├── token.c
│   │   │   │   └── token.h
│   │   │   ├── dir_ex_07/
│   │   │   │   ├── f1.c
│   │   │   │   ├── f1.h
│   │   │   │   ├── f2.c
│   │   │   │   ├── f2.h
│   │   │   │   ├── main.c
│   │   │   │   └── makefile
│   │   │   ├── ex_01.md
│   │   │   ├── ex_02.md
│   │   │   ├── ex_03.md
│   │   │   ├── ex_04.md
│   │   │   ├── ex_05.md
│   │   │   ├── ex_06.md
│   │   │   ├── ex_07.md
│   │   │   ├── ex_08.md
│   │   │   ├── ex_09.md
│   │   │   └── format_program/
│   │   │       ├── fmt.c
│   │   │       ├── line.c
│   │   │       ├── line.h
│   │   │       ├── makefile
│   │   │       ├── quote
│   │   │       ├── word.c
│   │   │       ├── word.h
│   │   │       └── 核心伪代码.txt
│   │   ├── ch16_结构_联合_枚举/
│   │   │   ├── build.sh
│   │   │   ├── dir_ex_08/
│   │   │   │   ├── invent.c
│   │   │   │   ├── makefile
│   │   │   │   ├── readline.c
│   │   │   │   └── readline.h
│   │   │   ├── dir_ex_09/
│   │   │   │   ├── invent.c
│   │   │   │   ├── makefile
│   │   │   │   ├── readline.c
│   │   │   │   └── readline.h
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_04.md
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.md
│   │   │   ├── ex_08.md
│   │   │   ├── ex_09.md
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.c
│   │   │   ├── ex_12.c
│   │   │   ├── ex_13.md
│   │   │   ├── ex_14.c
│   │   │   ├── ex_15.md
│   │   │   ├── ex_16.md
│   │   │   ├── ex_17.c
│   │   │   └── program_parts/
│   │   │       ├── invent.c
│   │   │       ├── makefile
│   │   │       ├── readline.c
│   │   │       └── readline.h
│   │   ├── ch17_指针的高级应用/
│   │   │   ├── build.sh
│   │   │   ├── dir_ex_04/
│   │   │   │   ├── invent.c
│   │   │   │   ├── makefile
│   │   │   │   ├── readline.c
│   │   │   │   └── readline.h
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.md
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.md
│   │   │   ├── ex_08.md
│   │   │   ├── ex_09.md
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.md
│   │   │   ├── ex_12.c
│   │   │   ├── ex_13.c
│   │   │   ├── ex_14.c
│   │   │   ├── ex_15.md
│   │   │   ├── ex_16.md
│   │   │   ├── ex_17.c
│   │   │   ├── list/
│   │   │   │   ├── list.c
│   │   │   │   ├── list.h
│   │   │   │   ├── main.c
│   │   │   │   └── makefile
│   │   │   ├── program_parts/
│   │   │   │   ├── invent.c
│   │   │   │   ├── makefile
│   │   │   │   ├── readline.c
│   │   │   │   └── readline.h
│   │   │   ├── remind2.c
│   │   │   └── tabulate.c
│   │   ├── ch18_声明/
│   │   │   ├── build.sh
│   │   │   ├── ex_01.md
│   │   │   ├── ex_02.md
│   │   │   ├── ex_03.md
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.md
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.c
│   │   │   ├── ex_09.c
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.c
│   │   │   ├── ex_12.md
│   │   │   └── example_register.c
│   │   ├── ch19_程序设计/
│   │   │   ├── build.sh
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.md
│   │   │   ├── ex_03.md
│   │   │   ├── ex_04.md
│   │   │   ├── ex_05.md
│   │   │   ├── ex_06.md
│   │   │   ├── ex_07.cpp
│   │   │   ├── ex_08.md
│   │   │   ├── ex_09.md
│   │   │   ├── ex_10.md
│   │   │   ├── queue/
│   │   │   │   ├── main.c
│   │   │   │   ├── makefile
│   │   │   │   ├── queue.h
│   │   │   │   ├── queue_impl1.c
│   │   │   │   └── queue_impl2.c
│   │   │   ├── queue2/
│   │   │   │   ├── main.c
│   │   │   │   ├── makefile
│   │   │   │   ├── queue.c
│   │   │   │   └── queue.h
│   │   │   ├── queue3/
│   │   │   │   ├── main.cpp
│   │   │   │   ├── makefile
│   │   │   │   ├── queue.cpp
│   │   │   │   └── queue.h
│   │   │   ├── queue4/
│   │   │   │   ├── main.cpp
│   │   │   │   ├── makefile
│   │   │   │   ├── queue.cpp
│   │   │   │   └── queue.h
│   │   │   └── stack/
│   │   │       ├── main.c
│   │   │       ├── makefile
│   │   │       ├── stack.c
│   │   │       └── stack.h
│   │   ├── ch20_低级程序设计/
│   │   │   ├── build.sh
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.c
│   │   │   ├── ex_09.c
│   │   │   ├── ex_10.c
│   │   │   ├── test_bit_field.c
│   │   │   └── xor.c
│   │   ├── ch21_标准库/
│   │   │   ├── build.sh
│   │   │   ├── ex_01.md
│   │   │   ├── ex_02.md
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.md
│   │   │   └── ex_05.c
│   │   ├── ch22_输入_输出/
│   │   │   ├── build.sh
│   │   │   ├── canopen.c
│   │   │   ├── dir_ex_19/
│   │   │   │   ├── invent.c
│   │   │   │   ├── makefile
│   │   │   │   ├── readline.c
│   │   │   │   └── readline.h
│   │   │   ├── dir_ex_21/
│   │   │   │   ├── invent.c
│   │   │   │   ├── makefile
│   │   │   │   ├── readline.c
│   │   │   │   └── readline.h
│   │   │   ├── ex_01.md
│   │   │   ├── ex_02.md
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.c
│   │   │   ├── ex_09.c
│   │   │   ├── ex_10.md
│   │   │   ├── ex_11.md
│   │   │   ├── ex_12.c
│   │   │   ├── ex_13.c
│   │   │   ├── ex_14.c
│   │   │   ├── ex_15.c
│   │   │   ├── ex_16.c
│   │   │   ├── ex_17.c
│   │   │   ├── ex_18.c
│   │   │   ├── ex_19.md
│   │   │   ├── ex_20.c
│   │   │   ├── ex_21.md
│   │   │   ├── ex_22.c
│   │   │   ├── ex_23.c
│   │   │   ├── fcopy.c
│   │   │   ├── invclear.c
│   │   │   ├── invent
│   │   │   ├── invent.rle
│   │   │   └── test_enter.c
│   │   ├── ch23_库对数值和字符数据的支持/
│   │   │   ├── build.sh
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.c
│   │   │   ├── ex_09.md
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.c
│   │   │   ├── ex_12.c
│   │   │   ├── ex_13.c
│   │   │   └── tcasemap.c
│   │   ├── ch24_错误处理/
│   │   │   ├── build.sh
│   │   │   ├── dir_ex_04/
│   │   │   │   ├── invent.c
│   │   │   │   ├── makefile
│   │   │   │   ├── readline.c
│   │   │   │   └── readline.h
│   │   │   ├── ex_01.md
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.md
│   │   │   ├── tsetjmp.c
│   │   │   └── tsignal.c
│   │   ├── ch25_国际化特性/
│   │   │   ├── build.sh
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   └── ex_04.md
│   │   ├── ch26_其他库函数/
│   │   │   ├── airmiles.c
│   │   │   ├── build.sh
│   │   │   ├── datetime.c
│   │   │   ├── errorf.c
│   │   │   ├── ex_01.c
│   │   │   ├── ex_02.c
│   │   │   ├── ex_03.c
│   │   │   ├── ex_04.c
│   │   │   ├── ex_05.c
│   │   │   ├── ex_06.c
│   │   │   ├── ex_07.c
│   │   │   ├── ex_08.c
│   │   │   ├── ex_09.c
│   │   │   ├── ex_10.c
│   │   │   ├── ex_11.c
│   │   │   ├── ex_12.c
│   │   │   ├── ex_13.c
│   │   │   ├── ex_14.c
│   │   │   ├── max_int.c
│   │   │   ├── trand.c
│   │   │   └── tstrconv.c
│   │   └── gen_readme.sh
│   └── CppPrimer/
│       ├── README.md
│       ├── build_all.sh
│       ├── ch01_Getting_Started/
│       │   ├── Sales_item.h
│       │   ├── build.sh
│       │   ├── data/
│       │   │   ├── add_item
│       │   │   └── book_sales
│       │   ├── example_comments.cpp
│       │   ├── example_for.cpp
│       │   ├── example_if.cpp
│       │   ├── example_iostream.cpp
│       │   ├── example_main.cpp
│       │   ├── example_while.cpp
│       │   ├── exercise_1_01.cpp
│       │   ├── exercise_1_02.cpp
│       │   ├── exercise_1_03.cpp
│       │   ├── exercise_1_04.cpp
│       │   ├── exercise_1_05.cpp
│       │   ├── exercise_1_06.cpp
│       │   ├── exercise_1_07.cpp
│       │   ├── exercise_1_08.cpp
│       │   ├── exercise_1_09.cpp
│       │   ├── exercise_1_10.cpp
│       │   ├── exercise_1_11.cpp
│       │   ├── exercise_1_12.cpp
│       │   ├── exercise_1_13.cpp
│       │   ├── exercise_1_14.cpp
│       │   ├── exercise_1_15.cpp
│       │   ├── exercise_1_16.cpp
│       │   ├── exercise_1_17.cpp
│       │   ├── exercise_1_18.cpp
│       │   ├── exercise_1_19.cpp
│       │   ├── exercise_1_20.cpp
│       │   ├── exercise_1_21.cpp
│       │   ├── exercise_1_22.cpp
│       │   ├── exercise_1_23.cpp
│       │   ├── exercise_1_24.cpp
│       │   ├── exercise_1_25.cpp
│       │   ├── test_clog.cpp
│       │   ├── usage_Sales_item_avg_price.cpp
│       │   ├── usage_add_Sales_item.cpp
│       │   └── usage_read_inputs.cpp
│       ├── ch02_Variables_and_Basic_Types/
│       │   ├── Sales_data.h
│       │   ├── build.sh
│       │   ├── data/
│       │   │   ├── add_item
│       │   │   └── book_sales
│       │   ├── exercise_2_01.txt
│       │   ├── exercise_2_02.txt
│       │   ├── exercise_2_03.txt
│       │   ├── exercise_2_04.cpp
│       │   ├── exercise_2_05.txt
│       │   ├── exercise_2_06.cpp
│       │   ├── exercise_2_07.cpp
│       │   ├── exercise_2_08.cpp
│       │   ├── exercise_2_09.cpp
│       │   ├── exercise_2_10.cpp
│       │   ├── exercise_2_11.txt
│       │   ├── exercise_2_12.txt
│       │   ├── exercise_2_13.cpp
│       │   ├── exercise_2_14.cpp
│       │   ├── exercise_2_15.txt
│       │   ├── exercise_2_16.cpp
│       │   ├── exercise_2_17.cpp
│       │   ├── exercise_2_18.cpp
│       │   ├── exercise_2_19.txt
│       │   ├── exercise_2_20.cpp
│       │   ├── exercise_2_21.txt
│       │   ├── exercise_2_22.txt
│       │   ├── exercise_2_23.txt
│       │   ├── exercise_2_24.txt
│       │   ├── exercise_2_25.txt
│       │   ├── exercise_2_26.txt
│       │   ├── exercise_2_27.cpp
│       │   ├── exercise_2_28.txt
│       │   ├── exercise_2_29.txt
│       │   ├── exercise_2_30.txt
│       │   ├── exercise_2_31.txt
│       │   ├── exercise_2_32.txt
│       │   ├── exercise_2_33.txt
│       │   ├── exercise_2_34.cpp
│       │   ├── exercise_2_35.cpp
│       │   ├── exercise_2_36.cpp
│       │   ├── exercise_2_37.txt
│       │   ├── exercise_2_38.md
│       │   ├── exercise_2_39.cpp
│       │   ├── exercise_2_40.cpp
│       │   ├── exercise_2_41.cpp
│       │   ├── exercise_2_42.cpp
│       │   ├── test_char.cpp
│       │   ├── test_list_initialization.cpp
│       │   └── test_literal.cpp
│       ├── ch03_Strings_Vectors_and_Arrays/
│       │   ├── build.sh
│       │   ├── example_getline.cpp
│       │   ├── example_normal_array_simulate_dimensional_array.cpp
│       │   ├── example_push_back.cpp
│       │   ├── example_range_for.cpp
│       │   ├── example_read_string.cpp
│       │   ├── example_using_iterators.cpp
│       │   ├── example_using_subscript.cpp
│       │   ├── exercise_3_01.cpp
│       │   ├── exercise_3_02.cpp
│       │   ├── exercise_3_03.txt
│       │   ├── exercise_3_04a.cpp
│       │   ├── exercise_3_04b.cpp
│       │   ├── exercise_3_05a.cpp
│       │   ├── exercise_3_05b.cpp
│       │   ├── exercise_3_06.cpp
│       │   ├── exercise_3_07.cpp
│       │   ├── exercise_3_08a.cpp
│       │   ├── exercise_3_08b.cpp
│       │   ├── exercise_3_09.txt
│       │   ├── exercise_3_10.cpp
│       │   ├── exercise_3_11.txt
│       │   ├── exercise_3_12.txt
│       │   ├── exercise_3_13.cpp
│       │   ├── exercise_3_14.cpp
│       │   ├── exercise_3_15.cpp
│       │   ├── exercise_3_16.cpp
│       │   ├── exercise_3_17.cpp
│       │   ├── exercise_3_18.txt
│       │   ├── exercise_3_19.cpp
│       │   ├── exercise_3_20a.cpp
│       │   ├── exercise_3_20b.cpp
│       │   ├── exercise_3_21.cpp
│       │   ├── exercise_3_22.cpp
│       │   ├── exercise_3_23.cpp
│       │   ├── exercise_3_24a.cpp
│       │   ├── exercise_3_24b.cpp
│       │   ├── exercise_3_25.cpp
│       │   ├── exercise_3_26.txt
│       │   ├── exercise_3_27.txt
│       │   ├── exercise_3_28.cpp
│       │   ├── exercise_3_29.txt
│       │   ├── exercise_3_30.txt
│       │   ├── exercise_3_31.cpp
│       │   ├── exercise_3_32a.cpp
│       │   ├── exercise_3_32b.cpp
│       │   ├── exercise_3_33.txt
│       │   ├── exercise_3_34.txt
│       │   ├── exercise_3_35.cpp
│       │   ├── exercise_3_36a.cpp
│       │   ├── exercise_3_36b.cpp
│       │   ├── exercise_3_37.cpp
│       │   ├── exercise_3_38.txt
│       │   ├── exercise_3_39a.cpp
│       │   ├── exercise_3_39b.cpp
│       │   ├── exercise_3_40.cpp
│       │   ├── exercise_3_41.cpp
│       │   ├── exercise_3_42.cpp
│       │   ├── exercise_3_43a.cpp
│       │   ├── exercise_3_43b.cpp
│       │   ├── exercise_3_43c.cpp
│       │   ├── exercise_3_44.cpp
│       │   ├── exercise_3_45.cpp
│       │   ├── usage_bsearch.cpp
│       │   ├── usage_count_punct_in_string.cpp
│       │   └── usage_string_toupper.cpp
│       ├── ch04_Expressions/
│       │   ├── build.sh
│       │   ├── example_comma_operator.cpp
│       │   ├── example_increment_operator.cpp
│       │   ├── exercise_4_01.txt
│       │   ├── exercise_4_02.txt
│       │   ├── exercise_4_03.txt
│       │   ├── exercise_4_04.cpp
│       │   ├── exercise_4_05.txt
│       │   ├── exercise_4_06.txt
│       │   ├── exercise_4_07.cpp
│       │   ├── exercise_4_08.txt
│       │   ├── exercise_4_09.txt
│       │   ├── exercise_4_10.cpp
│       │   ├── exercise_4_11.txt
│       │   ├── exercise_4_12.txt
│       │   ├── exercise_4_13.cpp
│       │   ├── exercise_4_14.txt
│       │   ├── exercise_4_15.txt
│       │   ├── exercise_4_16.cpp
│       │   ├── exercise_4_17.txt
│       │   ├── exercise_4_18.txt
│       │   ├── exercise_4_19.txt
│       │   ├── exercise_4_20.txt
│       │   ├── exercise_4_21.cpp
│       │   ├── exercise_4_22a.cpp
│       │   ├── exercise_4_22b.cpp
│       │   ├── exercise_4_23.cpp
│       │   ├── exercise_4_24.txt
│       │   ├── exercise_4_25.cpp
│       │   ├── exercise_4_26.txt
│       │   ├── exercise_4_27.cpp
│       │   ├── exercise_4_28.cpp
│       │   ├── exercise_4_29.cpp
│       │   ├── exercise_4_30.txt
│       │   ├── exercise_4_31.cpp
│       │   ├── exercise_4_32.txt
│       │   ├── exercise_4_33.txt
│       │   ├── exercise_4_34.txt
│       │   ├── exercise_4_35.txt
│       │   ├── exercise_4_36.txt
│       │   ├── exercise_4_37.txt
│       │   ├── exercise_4_38.txt
│       │   ├── test_bitwise_oparator.cpp
│       │   └── test_sizeof.cpp
│       ├── ch05_Statements/
│       │   ├── build.sh
│       │   ├── data/
│       │   │   └── vowels.txt
│       │   ├── example_do_while.cpp
│       │   ├── example_if_statement.cpp
│       │   ├── exercise_5_01.txt
│       │   ├── exercise_5_02.txt
│       │   ├── exercise_5_03.cpp
│       │   ├── exercise_5_04.txt
│       │   ├── exercise_5_05.cpp
│       │   ├── exercise_5_06.cpp
│       │   ├── exercise_5_07.txt
│       │   ├── exercise_5_08.txt
│       │   ├── exercise_5_09.cpp
│       │   ├── exercise_5_10.cpp
│       │   ├── exercise_5_11.cpp
│       │   ├── exercise_5_12.cpp
│       │   ├── exercise_5_13.txt
│       │   ├── exercise_5_14.cpp
│       │   ├── exercise_5_15.txt
│       │   ├── exercise_5_16a.cpp
│       │   ├── exercise_5_16b.cpp
│       │   ├── exercise_5_16c.cpp
│       │   ├── exercise_5_16d.cpp
│       │   ├── exercise_5_17.cpp
│       │   ├── exercise_5_18.txt
│       │   ├── exercise_5_19.cpp
│       │   ├── exercise_5_20.cpp
│       │   ├── exercise_5_21.cpp
│       │   ├── exercise_5_22.txt
│       │   ├── exercise_5_23.cpp
│       │   ├── exercise_5_24.cpp
│       │   └── exercise_5_25.cpp
│       ├── ch06_Functions/
│       │   ├── Chapter6.h
│       │   ├── build.sh
│       │   ├── example_array_param.cpp
│       │   ├── example_const_cast_and_overloading.cpp
│       │   ├── example_functions_with_no_return_value.cpp
│       │   ├── example_initializer_list_param.cpp
│       │   ├── example_inline_functions.cpp
│       │   ├── example_passing_a_multidimensional_array.cpp
│       │   ├── example_preprocessor_variable.cpp
│       │   ├── example_recursion.cpp
│       │   ├── example_return_from_main.cpp
│       │   ├── example_returning_a_pointer_to_an_array.cpp
│       │   ├── example_using_ref_to_avoid_cp.cpp
│       │   ├── example_using_ref_to_return_info.cpp
│       │   ├── exercise_6_01.txt
│       │   ├── exercise_6_02.txt
│       │   ├── exercise_6_03.cpp
│       │   ├── exercise_6_04.cpp
│       │   ├── exercise_6_05.cpp
│       │   ├── exercise_6_06.cpp
│       │   ├── exercise_6_07.cpp
│       │   ├── exercise_6_08.txt
│       │   ├── exercise_6_09/
│       │   │   ├── build.sh
│       │   │   ├── exercise_6_09.txt
│       │   │   ├── fact.cc
│       │   │   └── factMain.cc
│       │   ├── exercise_6_10.cpp
│       │   ├── exercise_6_11.cpp
│       │   ├── exercise_6_12.cpp
│       │   ├── exercise_6_13.txt
│       │   ├── exercise_6_14.txt
│       │   ├── exercise_6_15.txt
│       │   ├── exercise_6_16.md
│       │   ├── exercise_6_17.cpp
│       │   ├── exercise_6_18.md
│       │   ├── exercise_6_19.md
│       │   ├── exercise_6_20.md
│       │   ├── exercise_6_21.cpp
│       │   ├── exercise_6_22.cpp
│       │   ├── exercise_6_23.cpp
│       │   ├── exercise_6_24.cpp
│       │   ├── exercise_6_25.cpp
│       │   ├── exercise_6_26.cpp
│       │   ├── exercise_6_27.cpp
│       │   ├── exercise_6_28.md
│       │   ├── exercise_6_29.md
│       │   ├── exercise_6_30.cpp
│       │   ├── exercise_6_31.md
│       │   ├── exercise_6_32.md
│       │   ├── exercise_6_33.cpp
│       │   ├── exercise_6_34.cpp
│       │   ├── exercise_6_35.md
│       │   ├── exercise_6_36.cpp
│       │   ├── exercise_6_37.cpp
│       │   ├── exercise_6_38.cpp
│       │   ├── exercise_6_39.md
│       │   ├── exercise_6_40.md
│       │   ├── exercise_6_41.md
│       │   ├── exercise_6_42.cpp
│       │   ├── exercise_6_43.md
│       │   ├── exercise_6_44.cpp
│       │   ├── exercise_6_45.md
│       │   ├── exercise_6_46.cpp
│       │   ├── exercise_6_47.cpp
│       │   ├── exercise_6_48.md
│       │   ├── exercise_6_49.md
│       │   ├── exercise_6_50.md
│       │   ├── exercise_6_51.cpp
│       │   ├── exercise_6_52.md
│       │   ├── exercise_6_53.md
│       │   ├── exercise_6_54.cpp
│       │   ├── exercise_6_55.cpp
│       │   └── exercise_6_56.cpp
│       ├── ch07_Classes/
│       │   ├── build.sh
│       │   ├── data/
│       │   │   ├── add_item
│       │   │   └── book_sales
│       │   ├── example_Account/
│       │   │   ├── Account.cpp
│       │   │   ├── Account.h
│       │   │   ├── Makefile
│       │   │   └── main.cpp
│       │   ├── example_Person.cpp
│       │   ├── example_Sales_data/
│       │   │   ├── Makefile
│       │   │   ├── Sales_data.h
│       │   │   ├── exceptions.h
│       │   │   └── main.cpp
│       │   ├── example_Screen/
│       │   │   ├── Makefile
│       │   │   ├── Screen.h
│       │   │   ├── Window_mgr.h
│       │   │   └── main.cpp
│       │   ├── example_literal_classes/
│       │   │   ├── Debug.h
│       │   │   ├── Makefile
│       │   │   └── main.cpp
│       │   ├── exercise_7_01.cpp
│       │   ├── exercise_7_02.cpp
│       │   ├── exercise_7_03.cpp
│       │   ├── exercise_7_04.cpp
│       │   ├── exercise_7_05.cpp
│       │   ├── exercise_7_06.cpp
│       │   ├── exercise_7_07.cpp
│       │   ├── exercise_7_08.md
│       │   ├── exercise_7_09.cpp
│       │   ├── exercise_7_10.md
│       │   ├── exercise_7_11.cpp
│       │   ├── exercise_7_12.cpp
│       │   ├── exercise_7_13.cpp
│       │   ├── exercise_7_14.md
│       │   ├── exercise_7_15.cpp
│       │   ├── exercise_7_16.md
│       │   ├── exercise_7_17.md
│       │   ├── exercise_7_18.md
│       │   ├── exercise_7_19.cpp
│       │   ├── exercise_7_20.md
│       │   ├── exercise_7_21.md
│       │   ├── exercise_7_22.cpp
│       │   ├── exercise_7_23.cpp
│       │   ├── exercise_7_24.cpp
│       │   ├── exercise_7_25.md
│       │   ├── exercise_7_26.md
│       │   ├── exercise_7_27.cpp
│       │   ├── exercise_7_28.md
│       │   ├── exercise_7_29.cpp
│       │   ├── exercise_7_30.md
│       │   ├── exercise_7_31.cpp
│       │   ├── exercise_7_32.cpp
│       │   ├── exercise_7_33.md
│       │   ├── exercise_7_34.md
│       │   ├── exercise_7_35.cpp
│       │   ├── exercise_7_36.cpp
│       │   ├── exercise_7_37.md
│       │   ├── exercise_7_38.cpp
│       │   ├── exercise_7_39.md
│       │   ├── exercise_7_40.cpp
│       │   ├── exercise_7_41.cpp
│       │   ├── exercise_7_42.cpp
│       │   ├── exercise_7_43.cpp
│       │   ├── exercise_7_44.md
│       │   ├── exercise_7_45.md
│       │   ├── exercise_7_46.md
│       │   ├── exercise_7_47.md
│       │   ├── exercise_7_48.md
│       │   ├── exercise_7_49.md
│       │   ├── exercise_7_50.md
│       │   ├── exercise_7_51.md
│       │   ├── exercise_7_52.md
│       │   ├── exercise_7_53.md
│       │   ├── exercise_7_54.md
│       │   ├── exercise_7_55.md
│       │   ├── exercise_7_56.md
│       │   ├── exercise_7_57.md
│       │   ├── exercise_7_58.md
│       │   └── test_incomplete_type.cpp
│       ├── ch08_The_IO_Library/
│       │   ├── build.sh
│       │   ├── data/
│       │   │   ├── person_numbers.txt
│       │   │   └── some_words.txt
│       │   ├── example_fstream.cpp
│       │   ├── example_istringstream.cpp
│       │   ├── exercise_8_01.cpp
│       │   ├── exercise_8_02.md
│       │   ├── exercise_8_03.md
│       │   ├── exercise_8_04.cpp
│       │   ├── exercise_8_05.cpp
│       │   ├── exercise_8_06.cpp
│       │   ├── exercise_8_07.cpp
│       │   ├── exercise_8_08.cpp
│       │   ├── exercise_8_09.cpp
│       │   ├── exercise_8_10.cpp
│       │   ├── exercise_8_11.cpp
│       │   ├── exercise_8_12.md
│       │   ├── exercise_8_13.cpp
│       │   └── exercise_8_14.md
│       ├── ch09_Sequential_Containers/
│       │   ├── build.sh
│       │   ├── data/
│       │   │   └── letter.txt
│       │   ├── example_capacity_size.cpp
│       │   ├── example_change_container_in_loop.cpp
│       │   ├── example_erase.cpp
│       │   ├── example_forward_list.cpp
│       │   ├── example_insert.cpp
│       │   ├── example_iterator_range.cpp
│       │   ├── exercise_9_01.md
│       │   ├── exercise_9_02.cpp
│       │   ├── exercise_9_03.md
│       │   ├── exercise_9_04.cpp
│       │   ├── exercise_9_05.cpp
│       │   ├── exercise_9_06.md
│       │   ├── exercise_9_07.md
│       │   ├── exercise_9_08.md
│       │   ├── exercise_9_09.md
│       │   ├── exercise_9_10.md
│       │   ├── exercise_9_11.cpp
│       │   ├── exercise_9_12.md
│       │   ├── exercise_9_13.cpp
│       │   ├── exercise_9_14.cpp
│       │   ├── exercise_9_15.cpp
│       │   ├── exercise_9_16.cpp
│       │   ├── exercise_9_17.md
│       │   ├── exercise_9_18.cpp
│       │   ├── exercise_9_19.cpp
│       │   ├── exercise_9_20.cpp
│       │   ├── exercise_9_21.md
│       │   ├── exercise_9_22.md
│       │   ├── exercise_9_23.md
│       │   ├── exercise_9_24.cpp
│       │   ├── exercise_9_25.cpp
│       │   ├── exercise_9_26.cpp
│       │   ├── exercise_9_27.cpp
│       │   ├── exercise_9_28.cpp
│       │   ├── exercise_9_29.md
│       │   ├── exercise_9_30.md
│       │   ├── exercise_9_31.cpp
│       │   ├── exercise_9_32.md
│       │   ├── exercise_9_33.cpp
│       │   ├── exercise_9_34.cpp
│       │   ├── exercise_9_35.md
│       │   ├── exercise_9_36.md
│       │   ├── exercise_9_37.md
│       │   ├── exercise_9_38.cpp
│       │   ├── exercise_9_39.md
│       │   ├── exercise_9_40.cpp
│       │   ├── exercise_9_41.cpp
│       │   ├── exercise_9_42.md
│       │   ├── exercise_9_43.cpp
│       │   ├── exercise_9_44.cpp
│       │   ├── exercise_9_45.cpp
│       │   ├── exercise_9_46.cpp
│       │   ├── exercise_9_47.cpp
│       │   ├── exercise_9_48.cpp
│       │   ├── exercise_9_49.cpp
│       │   ├── exercise_9_50.cpp
│       │   ├── exercise_9_51.cpp
│       │   └── exercise_9_52.cpp
│       ├── ch10_Generic_Algorithms/
│       │   ├── build.sh
│       │   ├── example_back_inserter.cpp
│       │   ├── example_istream_iterator.cpp
│       │   ├── example_lambda.cpp
│       │   ├── example_ostream_iterator.cpp
│       │   ├── example_stable_partition.cpp
│       │   ├── example_stable_sort.cpp
│       │   ├── example_unique.cpp
│       │   ├── exercise_10_01.cpp
│       │   ├── exercise_10_02.cpp
│       │   ├── exercise_10_03.cpp
│       │   ├── exercise_10_04.cpp
│       │   ├── exercise_10_05.md
│       │   ├── exercise_10_06.cpp
│       │   ├── exercise_10_07.md
│       │   ├── exercise_10_08.md
│       │   ├── exercise_10_09.cpp
│       │   ├── exercise_10_10.md
│       │   ├── exercise_10_11.cpp
│       │   ├── exercise_10_12.cpp
│       │   ├── exercise_10_13.cpp
│       │   ├── exercise_10_14.cpp
│       │   ├── exercise_10_15.cpp
│       │   ├── exercise_10_16.cpp
│       │   ├── exercise_10_17.cpp
│       │   ├── exercise_10_18.cpp
│       │   ├── exercise_10_19.cpp
│       │   ├── exercise_10_20.cpp
│       │   ├── exercise_10_21.cpp
│       │   ├── exercise_10_22.cpp
│       │   ├── exercise_10_23.md
│       │   ├── exercise_10_24.cpp
│       │   ├── exercise_10_25.cpp
│       │   ├── exercise_10_26.md
│       │   ├── exercise_10_27.cpp
│       │   ├── exercise_10_28.cpp
│       │   ├── exercise_10_29.cpp
│       │   ├── exercise_10_30.cpp
│       │   ├── exercise_10_31.cpp
│       │   ├── exercise_10_32.cpp
│       │   ├── exercise_10_33.cpp
│       │   ├── exercise_10_34.cpp
│       │   ├── exercise_10_35.cpp
│       │   ├── exercise_10_36.cpp
│       │   ├── exercise_10_37.cpp
│       │   ├── exercise_10_38.md
│       │   ├── exercise_10_39.md
│       │   ├── exercise_10_40.md
│       │   ├── exercise_10_41.md
│       │   └── exercise_10_42.cpp
│       ├── ch11_Associative_Containers/
│       │   ├── build.sh
│       │   ├── data/
│       │   │   ├── test_rules.txt
│       │   │   └── trans_rules.txt
│       │   ├── example_init_multiset.cpp
│       │   ├── example_make_pair.cpp
│       │   ├── example_map.cpp
│       │   ├── example_multimap_find.cpp
│       │   ├── example_set.cpp
│       │   ├── example_unordered_set.cpp
│       │   ├── example_word_transform.cpp
│       │   ├── exercise_11_01.md
│       │   ├── exercise_11_02.md
│       │   ├── exercise_11_03.cpp
│       │   ├── exercise_11_04.cpp
│       │   ├── exercise_11_05.md
│       │   ├── exercise_11_06.md
│       │   ├── exercise_11_07.cpp
│       │   ├── exercise_11_08.cpp
│       │   ├── exercise_11_09.cpp
│       │   ├── exercise_11_10.md
│       │   ├── exercise_11_11.cpp
│       │   ├── exercise_11_12.cpp
│       │   ├── exercise_11_13.cpp
│       │   ├── exercise_11_14.cpp
│       │   ├── exercise_11_15.md
│       │   ├── exercise_11_16.md
│       │   ├── exercise_11_17.cpp
│       │   ├── exercise_11_18.md
│       │   ├── exercise_11_19.cpp
│       │   ├── exercise_11_20.cpp
│       │   ├── exercise_11_21.md
│       │   ├── exercise_11_22.md
│       │   ├── exercise_11_23.cpp
│       │   ├── exercise_11_24.md
│       │   ├── exercise_11_25.md
│       │   ├── exercise_11_26.md
│       │   ├── exercise_11_27.md
│       │   ├── exercise_11_28.cpp
│       │   ├── exercise_11_29.md
│       │   ├── exercise_11_30.md
│       │   ├── exercise_11_31.cpp
│       │   ├── exercise_11_32.cpp
│       │   ├── exercise_11_33.cpp
│       │   ├── exercise_11_34.md
│       │   ├── exercise_11_35.md
│       │   ├── exercise_11_36.md
│       │   ├── exercise_11_37.md
│       │   └── exercise_11_38.cpp
│       ├── ch12_Dynamic_Memory/
│       │   ├── build.sh
│       │   ├── example_StrBlob/
│       │   │   ├── Makefile
│       │   │   ├── StrBlob.cpp
│       │   │   ├── StrBlob.h
│       │   │   └── main.cpp
│       │   ├── example_StrBlobPtr/
│       │   │   ├── ConstStrBlobPtr.cpp
│       │   │   ├── ConstStrBlobPtr.h
│       │   │   ├── Makefile
│       │   │   ├── StrBlob.cpp
│       │   │   ├── StrBlob.h
│       │   │   ├── StrBlobPtr.cpp
│       │   │   ├── StrBlobPtr.h
│       │   │   └── main.cpp
│       │   ├── example_TextQuery/
│       │   │   ├── Makefile
│       │   │   ├── QueryResult.cpp
│       │   │   ├── QueryResult.h
│       │   │   ├── TextQuery.cpp
│       │   │   ├── TextQuery.h
│       │   │   └── main.cpp
│       │   ├── example_TextQuery2/
│       │   │   ├── Makefile
│       │   │   ├── QueryResult.cpp
│       │   │   ├── QueryResult.h
│       │   │   ├── TextQuery.cpp
│       │   │   ├── TextQuery.h
│       │   │   └── main.cpp
│       │   ├── example_TextQuery_use_StrVec/
│       │   │   ├── Makefile
│       │   │   ├── QueryResult.cpp
│       │   │   ├── QueryResult.h
│       │   │   ├── StrVec.cpp
│       │   │   ├── StrVec.h
│       │   │   ├── TextQuery.cpp
│       │   │   ├── TextQuery.h
│       │   │   └── main.cpp
│       │   ├── example_allocator.cpp
│       │   ├── example_using_own_deletion.cpp
│       │   ├── exercise_12_01.cpp
│       │   ├── exercise_12_02.md
│       │   ├── exercise_12_03.md
│       │   ├── exercise_12_04.md
│       │   ├── exercise_12_05.md
│       │   ├── exercise_12_06.cpp
│       │   ├── exercise_12_07.cpp
│       │   ├── exercise_12_08.md
│       │   ├── exercise_12_09.md
│       │   ├── exercise_12_10.md
│       │   ├── exercise_12_11.md
│       │   ├── exercise_12_12.md
│       │   ├── exercise_12_13.md
│       │   ├── exercise_12_14.md
│       │   ├── exercise_12_15.cpp
│       │   ├── exercise_12_16.cpp
│       │   ├── exercise_12_17.md
│       │   ├── exercise_12_18.md
│       │   ├── exercise_12_19.md
│       │   ├── exercise_12_20.cpp
│       │   ├── exercise_12_21.md
│       │   ├── exercise_12_22.md
│       │   ├── exercise_12_23.cpp
│       │   ├── exercise_12_24.cpp
│       │   ├── exercise_12_25.md
│       │   ├── exercise_12_26.cpp
│       │   ├── exercise_12_27.cpp
│       │   ├── exercise_12_28.cpp
│       │   ├── exercise_12_29.md
│       │   ├── exercise_12_30.md
│       │   ├── exercise_12_31.md
│       │   ├── exercise_12_32.cpp
│       │   └── exercise_12_33.md
│       ├── ch13_Copy_Control/
│       │   ├── build.sh
│       │   ├── example_Copy_Control/
│       │   │   ├── Folder.cpp
│       │   │   ├── Folder.h
│       │   │   ├── Makefile
│       │   │   ├── Message.cpp
│       │   │   ├── Message.h
│       │   │   └── main.cpp
│       │   ├── example_Reference_Count/
│       │   │   ├── HasPtr.cpp
│       │   │   ├── HasPtr.h
│       │   │   ├── Makefile
│       │   │   └── main.cpp
│       │   ├── example_Reference_Qualifier/
│       │   │   ├── Makefile
│       │   │   └── main.cpp
│       │   ├── example_StrVec/
│       │   │   ├── Makefile
│       │   │   ├── StrVec.cpp
│       │   │   ├── StrVec.h
│       │   │   └── main.cpp
│       │   ├── example_String/
│       │   │   ├── Makefile
│       │   │   ├── String.cpp
│       │   │   ├── String.h
│       │   │   └── main.cpp
│       │   ├── exercise_13_01.md
│       │   ├── exercise_13_02.md
│       │   ├── exercise_13_03.md
│       │   ├── exercise_13_04.md
│       │   ├── exercise_13_05.cpp
│       │   ├── exercise_13_06.md
│       │   ├── exercise_13_07.md
│       │   ├── exercise_13_08.cpp
│       │   ├── exercise_13_09.md
│       │   ├── exercise_13_10.md
│       │   ├── exercise_13_11.cpp
│       │   ├── exercise_13_12.md
│       │   ├── exercise_13_13.cpp
│       │   ├── exercise_13_14.md
│       │   ├── exercise_13_15.md
│       │   ├── exercise_13_16.md
│       │   ├── exercise_13_17.cpp
│       │   ├── exercise_13_18.cpp
│       │   ├── exercise_13_19.cpp
│       │   ├── exercise_13_20.md
│       │   ├── exercise_13_21.md
│       │   ├── exercise_13_22.md
│       │   ├── exercise_13_23.md
│       │   ├── exercise_13_24.md
│       │   ├── exercise_13_25.md
│       │   ├── exercise_13_26.cpp
│       │   ├── exercise_13_27.md
│       │   ├── exercise_13_28.cpp
│       │   ├── exercise_13_29.md
│       │   ├── exercise_13_30.cpp
│       │   ├── exercise_13_31.cpp
│       │   ├── exercise_13_32.md
│       │   ├── exercise_13_33.md
│       │   ├── exercise_13_34.md
│       │   ├── exercise_13_35.md
│       │   ├── exercise_13_36.md
│       │   ├── exercise_13_37.md
│       │   ├── exercise_13_38.md
│       │   ├── exercise_13_39.md
│       │   ├── exercise_13_40.md
│       │   ├── exercise_13_41.md
│       │   ├── exercise_13_42.md
│       │   ├── exercise_13_43.md
│       │   ├── exercise_13_44.md
│       │   ├── exercise_13_45.md
│       │   ├── exercise_13_46.md
│       │   ├── exercise_13_47.md
│       │   ├── exercise_13_48.md
│       │   ├── exercise_13_49.md
│       │   ├── exercise_13_50.md
│       │   ├── exercise_13_51.md
│       │   ├── exercise_13_52.md
│       │   ├── exercise_13_53.cpp
│       │   ├── exercise_13_54.md
│       │   ├── exercise_13_55.md
│       │   ├── exercise_13_56.md
│       │   ├── exercise_13_57.md
│       │   └── exercise_13_58.cpp
│       ├── ch14_Overloaded_Operations_and_Conversions/
│       │   ├── build.sh
│       │   ├── example_conversion_operators.cpp
│       │   ├── example_function-call_operator.cpp
│       │   ├── example_function.cpp
│       │   ├── example_std_funcobj.cpp
│       │   ├── exercise_14_01.md
│       │   ├── exercise_14_02.md
│       │   ├── exercise_14_03.md
│       │   ├── exercise_14_04.md
│       │   ├── exercise_14_05.cpp
│       │   ├── exercise_14_06.md
│       │   ├── exercise_14_07.md
│       │   ├── exercise_14_08.md
│       │   ├── exercise_14_09.md
│       │   ├── exercise_14_10.md
│       │   ├── exercise_14_11.md
│       │   ├── exercise_14_12.md
│       │   ├── exercise_14_13.md
│       │   ├── exercise_14_14.md
│       │   ├── exercise_14_15.md
│       │   ├── exercise_14_16.md
│       │   ├── exercise_14_17.md
│       │   ├── exercise_14_18.md
│       │   ├── exercise_14_19.md
│       │   ├── exercise_14_20.md
│       │   ├── exercise_14_21.md
│       │   ├── exercise_14_22.md
│       │   ├── exercise_14_23.md
│       │   ├── exercise_14_24.cpp
│       │   ├── exercise_14_25.md
│       │   ├── exercise_14_26.md
│       │   ├── exercise_14_27.md
│       │   ├── exercise_14_28.md
│       │   ├── exercise_14_29.md
│       │   ├── exercise_14_30.md
│       │   ├── exercise_14_31.md
│       │   ├── exercise_14_32.cpp
│       │   ├── exercise_14_33.md
│       │   ├── exercise_14_34.cpp
│       │   ├── exercise_14_35.cpp
│       │   ├── exercise_14_36.cpp
│       │   ├── exercise_14_37.cpp
│       │   ├── exercise_14_38.cpp
│       │   ├── exercise_14_39.cpp
│       │   ├── exercise_14_40.cpp
│       │   ├── exercise_14_41.md
│       │   ├── exercise_14_42.cpp
│       │   ├── exercise_14_43.cpp
│       │   ├── exercise_14_44.cpp
│       │   ├── exercise_14_45.md
│       │   ├── exercise_14_46.md
│       │   ├── exercise_14_47.md
│       │   ├── exercise_14_48.md
│       │   ├── exercise_14_49.md
│       │   ├── exercise_14_50.cpp
│       │   ├── exercise_14_51.cpp
│       │   ├── exercise_14_52.md
│       │   └── exercise_14_53.cpp
│       ├── ch15_Object-Oriented_Programming/
│       │   ├── build.sh
│       │   ├── example_Access_Control_and_Inheritance/
│       │   │   ├── Makefile
│       │   │   ├── classes.hpp
│       │   │   └── main.cpp
│       │   ├── example_TextQuery/
│       │   │   ├── Makefile
│       │   │   ├── Query.cpp
│       │   │   ├── Query.h
│       │   │   ├── QueryResult.cpp
│       │   │   ├── QueryResult.h
│       │   │   ├── Query_ex15_37.h
│       │   │   ├── Query_ex15_41.cpp.bak
│       │   │   ├── Query_ex15_41.h
│       │   │   ├── TextQuery.cpp
│       │   │   ├── TextQuery.h
│       │   │   └── main.cpp
│       │   ├── example_abstract_base_class.cpp
│       │   ├── example_base_class.cpp
│       │   ├── example_basket.cpp
│       │   ├── example_derived_class.cpp
│       │   ├── example_derived_class_copy_control_members.cpp
│       │   ├── exercise_15_01.md
│       │   ├── exercise_15_02.md
│       │   ├── exercise_15_03.md
│       │   ├── exercise_15_04.md
│       │   ├── exercise_15_05.md
│       │   ├── exercise_15_06.cpp
│       │   ├── exercise_15_07.cpp
│       │   ├── exercise_15_08.md
│       │   ├── exercise_15_09.md
│       │   ├── exercise_15_10.md
│       │   ├── exercise_15_11.md
│       │   ├── exercise_15_12.md
│       │   ├── exercise_15_13.md
│       │   ├── exercise_15_14.md
│       │   ├── exercise_15_15.md
│       │   ├── exercise_15_16.cpp
│       │   ├── exercise_15_17.md
│       │   ├── exercise_15_18.cpp
│       │   ├── exercise_15_19.cpp
│       │   ├── exercise_15_20.md
│       │   ├── exercise_15_21.cpp
│       │   ├── exercise_15_22.md
│       │   ├── exercise_15_23.cpp
│       │   ├── exercise_15_24.md
│       │   ├── exercise_15_25.md
│       │   ├── exercise_15_26.md
│       │   ├── exercise_15_27.cpp
│       │   ├── exercise_15_28.md
│       │   ├── exercise_15_29.md
│       │   ├── exercise_15_30.md
│       │   ├── exercise_15_31.md
│       │   ├── exercise_15_32.md
│       │   ├── exercise_15_33.md
│       │   ├── exercise_15_34.md
│       │   ├── exercise_15_35.md
│       │   ├── exercise_15_36.md
│       │   ├── exercise_15_37.md
│       │   ├── exercise_15_38.md
│       │   ├── exercise_15_39.md
│       │   ├── exercise_15_40.md
│       │   ├── exercise_15_41.md
│       │   └── exercise_15_42.md
│       ├── ch16_Templates_and_GenericProgramming/
│       │   ├── build.sh
│       │   ├── example_Screen/
│       │   │   ├── Makefile
│       │   │   ├── Screen.h
│       │   │   └── main.cpp
│       │   ├── example_SmartPointer/
│       │   │   ├── Makefile
│       │   │   ├── SharedPtr.h
│       │   │   ├── UniquePtr.h
│       │   │   └── main.cpp
│       │   ├── example_Vec/
│       │   │   ├── Makefile
│       │   │   ├── Vec.h
│       │   │   └── main.cpp
│       │   ├── example_customer_MakeShared/
│       │   │   ├── MakeShared.h
│       │   │   ├── Makefile
│       │   │   └── main.cpp
│       │   ├── example_explicit_instantiation/
│       │   │   ├── Application.cpp
│       │   │   ├── Application.h
│       │   │   ├── Makefile
│       │   │   ├── TemplateBuild.cpp
│       │   │   ├── TemplateBuild.h
│       │   │   └── main.cpp
│       │   ├── example_function_template.cpp
│       │   ├── example_member_template/
│       │   │   ├── DebugDelete.h
│       │   │   ├── Makefile
│       │   │   └── main.cpp
│       │   ├── example_overload_and_template.cpp
│       │   ├── example_template_class/
│       │   │   ├── Blob.h
│       │   │   ├── BlobPtr.h
│       │   │   ├── Makefile
│       │   │   └── main.cpp
│       │   ├── example_variadic_template.cpp
│       │   ├── example_variadic_template2.cpp
│       │   ├── exercise_16_01.md
│       │   ├── exercise_16_02.md
│       │   ├── exercise_16_03.cpp
│       │   ├── exercise_16_04.cpp
│       │   ├── exercise_16_05.cpp
│       │   ├── exercise_16_06.cpp
│       │   ├── exercise_16_07.cpp
│       │   ├── exercise_16_08.md
│       │   ├── exercise_16_09.md
│       │   ├── exercise_16_10.md
│       │   ├── exercise_16_11.cpp
│       │   ├── exercise_16_12.md
│       │   ├── exercise_16_13.md
│       │   ├── exercise_16_14.md
│       │   ├── exercise_16_15.md
│       │   ├── exercise_16_16.md
│       │   ├── exercise_16_17.md
│       │   ├── exercise_16_18.cpp
│       │   ├── exercise_16_19.cpp
│       │   ├── exercise_16_20.cpp
│       │   ├── exercise_16_21.md
│       │   ├── exercise_16_22.md
│       │   ├── exercise_16_23.md
│       │   ├── exercise_16_24.md
│       │   ├── exercise_16_25.md
│       │   ├── exercise_16_26.cpp
│       │   ├── exercise_16_27.md
│       │   ├── exercise_16_28.md
│       │   ├── exercise_16_29.cpp
│       │   ├── exercise_16_30.md
│       │   ├── exercise_16_31.md
│       │   ├── exercise_16_32.md
│       │   ├── exercise_16_33.md
│       │   ├── exercise_16_34.md
│       │   ├── exercise_16_35.md
│       │   ├── exercise_16_36.md
│       │   ├── exercise_16_37.cpp
│       │   ├── exercise_16_38.md
│       │   ├── exercise_16_39.md
│       │   ├── exercise_16_40.cpp
│       │   ├── exercise_16_41.cpp
│       │   ├── exercise_16_42.md
│       │   ├── exercise_16_43.md
│       │   ├── exercise_16_44.md
│       │   ├── exercise_16_45.cpp
│       │   ├── exercise_16_46.md
│       │   ├── exercise_16_47.cpp
│       │   ├── exercise_16_48.md
│       │   ├── exercise_16_49.cpp
│       │   ├── exercise_16_50.md
│       │   ├── exercise_16_51.md
│       │   ├── exercise_16_52.md
│       │   ├── exercise_16_53.md
│       │   ├── exercise_16_54.md
│       │   ├── exercise_16_55.cpp
│       │   ├── exercise_16_56.md
│       │   ├── exercise_16_57.md
│       │   ├── exercise_16_58.md
│       │   ├── exercise_16_59.md
│       │   ├── exercise_16_60.md
│       │   ├── exercise_16_61.md
│       │   ├── exercise_16_62.md
│       │   ├── exercise_16_63.cpp
│       │   ├── exercise_16_64.md
│       │   ├── exercise_16_65.cpp
│       │   ├── exercise_16_66.md
│       │   └── exercise_16_67.md
│       ├── ch17_Specialized_Library_Facilities/
│       │   ├── build.sh
│       │   ├── data/
│       │   │   ├── test_rules.txt
│       │   │   └── trans_rules.txt
│       │   ├── example_formatted_io.cpp
│       │   ├── example_phone_number.cpp
│       │   ├── example_random.cpp
│       │   ├── example_regex_error.cpp
│       │   ├── example_regex_replace.cpp
│       │   ├── example_seek_tell.cpp
│       │   ├── example_sregex_iterator.cpp
│       │   ├── example_tuple.cpp
│       │   ├── example_unformatted_io.cpp
│       │   ├── example_using_regex.cpp
│       │   ├── example_using_subexpression.cpp
│       │   ├── exercise_17_01.cpp
│       │   ├── exercise_17_02.cpp
│       │   ├── exercise_17_03.cpp
│       │   ├── exercise_17_04.md
│       │   ├── exercise_17_05.cpp
│       │   ├── exercise_17_06.cpp
│       │   ├── exercise_17_07.md
│       │   ├── exercise_17_08.md
│       │   ├── exercise_17_09.cpp
│       │   ├── exercise_17_10.cpp
│       │   ├── exercise_17_11.cpp
│       │   ├── exercise_17_12.cpp
│       │   ├── exercise_17_13.cpp
│       │   ├── exercise_17_14.cpp
│       │   ├── exercise_17_15.cpp
│       │   ├── exercise_17_16.md
│       │   ├── exercise_17_17.md
│       │   ├── exercise_17_18.cpp
│       │   ├── exercise_17_19.md
│       │   ├── exercise_17_20.md
│       │   ├── exercise_17_21.cpp
│       │   ├── exercise_17_22.cpp
│       │   ├── exercise_17_23.cpp
│       │   ├── exercise_17_24.md
│       │   ├── exercise_17_25.cpp
│       │   ├── exercise_17_26.cpp
│       │   ├── exercise_17_27.cpp
│       │   ├── exercise_17_28.cpp
│       │   ├── exercise_17_29.cpp
│       │   ├── exercise_17_30.cpp
│       │   ├── exercise_17_31.md
│       │   ├── exercise_17_32.md
│       │   ├── exercise_17_33.cpp
│       │   ├── exercise_17_34.md
│       │   ├── exercise_17_35.cpp
│       │   ├── exercise_17_36.cpp
│       │   ├── exercise_17_37.cpp
│       │   ├── exercise_17_38.cpp
│       │   └── exercise_17_39.md
│       ├── ch18_Tools_for_Large_Programs/
│       │   ├── build.sh
│       │   ├── exercise_18_01.cpp
│       │   ├── exercise_18_02.md
│       │   ├── exercise_18_03.cpp
│       │   ├── exercise_18_04.md
│       │   ├── exercise_18_05.cpp
│       │   ├── exercise_18_06.cpp
│       │   ├── exercise_18_07.md
│       │   ├── exercise_18_08.md
│       │   ├── exercise_18_09.md
│       │   ├── exercise_18_10.md
│       │   ├── exercise_18_11.md
│       │   ├── exercise_18_12.md
│       │   ├── exercise_18_13.md
│       │   ├── exercise_18_14.cpp
│       │   ├── exercise_18_15.md
│       │   ├── exercise_18_16.cpp
│       │   ├── exercise_18_17.md
│       │   ├── exercise_18_18.cpp
│       │   ├── exercise_18_19.md
│       │   ├── exercise_18_20.cpp
│       │   ├── exercise_18_21.cpp
│       │   ├── exercise_18_22.cpp
│       │   ├── exercise_18_23.cpp
│       │   ├── exercise_18_24.md
│       │   ├── exercise_18_25.cpp
│       │   ├── exercise_18_26.cpp
│       │   ├── exercise_18_27.cpp
│       │   ├── exercise_18_28.cpp
│       │   ├── exercise_18_29.cpp
│       │   └── exercise_18_30.cpp
│       ├── ch19_Specialized_Tools_and_Techniques/
│       │   ├── build.sh
│       │   ├── example_function_table.cpp
│       │   ├── example_memfunc_as_callable_obj.cpp
│       │   ├── example_placement_new.cpp
│       │   ├── example_pointer_to_member.cpp
│       │   ├── example_type_info.cpp
│       │   ├── example_union_with_class.cpp
│       │   ├── example_use_RTTI.cpp
│       │   ├── exercise_19_01.cpp
│       │   ├── exercise_19_02.md
│       │   ├── exercise_19_03.cpp
│       │   ├── exercise_19_04.cpp
│       │   ├── exercise_19_05.md
│       │   ├── exercise_19_06.cpp
│       │   ├── exercise_19_07.cpp
│       │   ├── exercise_19_08.cpp
│       │   ├── exercise_19_09.md
│       │   ├── exercise_19_10.cpp
│       │   ├── exercise_19_11.md
│       │   ├── exercise_19_12.cpp
│       │   ├── exercise_19_13.cpp
│       │   ├── exercise_19_14.cpp
│       │   ├── exercise_19_15.md
│       │   ├── exercise_19_16.md
│       │   ├── exercise_19_17.md
│       │   ├── exercise_19_18.cpp
│       │   ├── exercise_19_19.cpp
│       │   ├── exercise_19_20.md
│       │   ├── exercise_19_21.md
│       │   ├── exercise_19_22.md
│       │   ├── exercise_19_23.md
│       │   ├── exercise_19_24.md
│       │   ├── exercise_19_25.md
│       │   └── exercise_19_26.cpp
│       ├── data/
│       │   ├── book_sales
│       │   ├── little_story.txt
│       │   ├── numbers.txt
│       │   ├── person_numbers.txt
│       │   └── some_words.txt
│       ├── defined_terms/
│       │   ├── ch01/
│       │   │   ├── argument.md
│       │   │   ├── assignment.md
│       │   │   ├── block.md
│       │   │   ├── buffer.md
│       │   │   ├── built-in_type.md
│       │   │   ├── cerr.md
│       │   │   ├── cin.md
│       │   │   ├── class.md
│       │   │   ├── class_type.md
│       │   │   ├── clog.md
│       │   │   ├── comment.md
│       │   │   ├── condition.md
│       │   │   ├── cout.md
│       │   │   ├── data_structure.md
│       │   │   ├── edit-compile-debug.md
│       │   │   ├── end-of-file.md
│       │   │   ├── expression.md
│       │   │   ├── for_statement.md
│       │   │   ├── function.md
│       │   │   ├── function_body.md
│       │   │   ├── function_name.md
│       │   │   ├── header.md
│       │   │   ├── if_statement.md
│       │   │   ├── initialize.md
│       │   │   ├── iostream.md
│       │   │   ├── istream.md
│       │   │   ├── main.md
│       │   │   ├── manipulator.md
│       │   │   ├── member_function.md
│       │   │   ├── namespace.md
│       │   │   ├── ostream.md
│       │   │   ├── parameter_list.md
│       │   │   ├── return_type.md
│       │   │   ├── source_file.md
│       │   │   ├── standard_error.md
│       │   │   ├── standard_input.md
│       │   │   ├── standard_library.md
│       │   │   ├── standard_output.md
│       │   │   ├── statement.md
│       │   │   ├── string_literal.md
│       │   │   ├── uninitialized_variable.md
│       │   │   ├── variable.md
│       │   │   ├── while_statement.md
│       │   │   ├── 不等运算符.md
│       │   │   ├── 作用域运算符.md
│       │   │   ├── 复合赋值运算符.md
│       │   │   ├── 大于等于运算符.md
│       │   │   ├── 大于运算符.md
│       │   │   ├── 头文件包含指令.md
│       │   │   ├── 小于等于运算符.md
│       │   │   ├── 小于运算符.md
│       │   │   ├── 点运算符.md
│       │   │   ├── 相等运算符.md
│       │   │   ├── 等号运算符.md
│       │   │   ├── 调用运算符.md
│       │   │   ├── 输入运算符.md
│       │   │   ├── 输出运算符.md
│       │   │   ├── 递减运算符.md
│       │   │   └── 递增运算符.md
│       │   ├── ch02/
│       │   │   ├── address.md
│       │   │   ├── alias_declaration.md
│       │   │   ├── arithmetic_type.md
│       │   │   ├── array.md
│       │   │   ├── auto.md
│       │   │   ├── base_type.md
│       │   │   ├── bind.md
│       │   │   ├── byte.md
│       │   │   ├── class_member.md
│       │   │   ├── compound_type.md
│       │   │   ├── const.md
│       │   │   ├── const_expression.md
│       │   │   ├── const_pointer.md
│       │   │   ├── const_reference.md
│       │   │   ├── conversion.md
│       │   │   ├── data_member.md
│       │   │   ├── declaration.md
│       │   │   ├── declarator.md
│       │   │   ├── decltype.md
│       │   │   ├── default_initialization.md
│       │   │   ├── definition.md
│       │   │   ├── escape_sequence.md
│       │   │   ├── global_scope.md
│       │   │   ├── header_guard.md
│       │   │   ├── identifier.md
│       │   │   ├── in-class_initializer.md
│       │   │   ├── list_initialization.md
│       │   │   ├── literal.md
│       │   │   ├── low-level_const.md
│       │   │   ├── nonprintable_character.md
│       │   │   ├── null_pointer.md
│       │   │   ├── nullptr.md
│       │   │   ├── object.md
│       │   │   ├── pointer.md
│       │   │   ├── pointer_to_const.md
│       │   │   ├── preprocessor.md
│       │   │   ├── preprocessor_variable.md
│       │   │   ├── reference.md
│       │   │   ├── reference_to_const.md
│       │   │   ├── scope.md
│       │   │   ├── separate_complilation.md
│       │   │   ├── signed.md
│       │   │   ├── string.md
│       │   │   ├── temporary.md
│       │   │   ├── top-level_const.md
│       │   │   ├── type_alias.md
│       │   │   ├── type_checking.md
│       │   │   ├── type_specifier.md
│       │   │   ├── undefined.md
│       │   │   ├── uninitialized.md
│       │   │   ├── unsigned.md
│       │   │   ├── variable.md
│       │   │   ├── void.md
│       │   │   └── word.md
│       │   ├── ch03/
│       │   │   ├── C-style_string.md
│       │   │   ├── begin.md
│       │   │   ├── buffer_overflow.md
│       │   │   ├── class_template.md
│       │   │   ├── compiler_extension.md
│       │   │   ├── container.md
│       │   │   ├── copy_initialization.md
│       │   │   ├── difference_type.md
│       │   │   ├── direct_initialization.md
│       │   │   ├── empty.md
│       │   │   ├── end.md
│       │   │   ├── getline.md
│       │   │   ├── index.md
│       │   │   ├── instantiation.md
│       │   │   ├── iterator.md
│       │   │   ├── iterator_arithmetic.md
│       │   │   ├── off-the-end_iterator.md
│       │   │   ├── pointer_arithmetic.md
│       │   │   ├── prtdiff_t.md
│       │   │   ├── push_back.md
│       │   │   ├── range_for.md
│       │   │   ├── size.md
│       │   │   ├── size_t.md
│       │   │   ├── size_type.md
│       │   │   ├── string.md
│       │   │   ├── using_declaration.md
│       │   │   ├── value_initialization.md
│       │   │   ├── vector.md
│       │   │   ├── 下标运算符.md
│       │   │   ├── 箭头运算符.md
│       │   │   ├── 输入运算符.md
│       │   │   ├── 输出运算符.md
│       │   │   ├── 递增运算符.md
│       │   │   ├── 逻辑与运算符.md
│       │   │   ├── 逻辑或运算符.md
│       │   │   └── 逻辑非运算符.md
│       │   ├── ch04/
│       │   │   ├── arithmetic_conversion.md
│       │   │   ├── associativity.md
│       │   │   ├── binary_operator.md
│       │   │   ├── cast.md
│       │   │   ├── compound_expression.md
│       │   │   ├── const_cast.md
│       │   │   ├── conversion.md
│       │   │   ├── expression.md
│       │   │   ├── implicit_conversion.md
│       │   │   ├── integral_promotion.md
│       │   │   ├── lvalue.md
│       │   │   ├── operand.md
│       │   │   ├── operator.md
│       │   │   ├── order_of_evaluation.md
│       │   │   ├── overloaded_operator.md
│       │   │   ├── precedence.md
│       │   │   ├── reinterpret_case.md
│       │   │   ├── rvalue.md
│       │   │   ├── short-circuit_evaluation.md
│       │   │   ├── sizeof.md
│       │   │   ├── static_cast.md
│       │   │   ├── unary_operators.md
│       │   │   ├── 位与运算符.md
│       │   │   ├── 位异或运算符.md
│       │   │   ├── 位或运算符.md
│       │   │   ├── 位求反运算符.md
│       │   │   ├── 右移运算符.md
│       │   │   ├── 左移运算符.md
│       │   │   ├── 条件运算符.md
│       │   │   ├── 递减运算符.md
│       │   │   ├── 递增运算符.md
│       │   │   └── 逗号运算符.md
│       │   ├── ch05/
│       │   │   ├── block.md
│       │   │   ├── break_statement.md
│       │   │   ├── case_label.md
│       │   │   ├── catch_clause.md
│       │   │   ├── compound_statement.md
│       │   │   ├── continue_statement.md
│       │   │   ├── dangling_else.md
│       │   │   ├── default_label.md
│       │   │   ├── do_while_statement.md
│       │   │   ├── exception_class.md
│       │   │   ├── exception_declaration.md
│       │   │   ├── exception_handler.md
│       │   │   ├── exception_safe.md
│       │   │   ├── expression_statement.md
│       │   │   ├── flow_of_control.md
│       │   │   ├── for_statement.md
│       │   │   ├── goto_statement.md
│       │   │   ├── if_else_statement.md
│       │   │   ├── if_statement.md
│       │   │   ├── labeled_statement.md
│       │   │   ├── null_statement.md
│       │   │   ├── raise.md
│       │   │   ├── range_for_statment.md
│       │   │   ├── switch_statement.md
│       │   │   ├── terminate.md
│       │   │   ├── throw_expression.md
│       │   │   ├── try_block.md
│       │   │   └── while_statement.md
│       │   ├── ch06/
│       │   │   ├── ambiguous_call.md
│       │   │   ├── argument.md
│       │   │   ├── assert.md
│       │   │   ├── automatic_object.md
│       │   │   ├── best_match.md
│       │   │   ├── candidate_function.md
│       │   │   ├── constexpr.md
│       │   │   ├── default_argument.md
│       │   │   ├── executable_file.md
│       │   │   ├── function_matching.md
│       │   │   ├── function_prototype.md
│       │   │   ├── hidden_name.md
│       │   │   ├── initializer_list.md
│       │   │   ├── inline_function.md
│       │   │   ├── link.md
│       │   │   ├── local_static_object.md
│       │   │   ├── local_variable.md
│       │   │   ├── no_match.md
│       │   │   ├── object_code.md
│       │   │   ├── object_file.md
│       │   │   ├── object_lifetime.md
│       │   │   ├── overloaded_function.md
│       │   │   ├── parameter.md
│       │   │   ├── pass_by_reference.md
│       │   │   ├── pass_by_value.md
│       │   │   ├── preprocessor_macro.md
│       │   │   ├── recursion_loop.md
│       │   │   ├── recursive_function.md
│       │   │   ├── return_type.md
│       │   │   ├── trailing_return_type.md
│       │   │   └── viable_function.md
│       │   ├── ch07/
│       │   │   ├── =default.md
│       │   │   ├── abstract_data_type.md
│       │   │   ├── access_specifier.md
│       │   │   ├── aggregate_class.md
│       │   │   ├── class.md
│       │   │   ├── class_declaration.md
│       │   │   ├── class_scope.md
│       │   │   ├── const_member_function.md
│       │   │   ├── constructor.md
│       │   │   ├── constructor_initializer_list.md
│       │   │   ├── converting_constructor.md
│       │   │   ├── data_abstraction.md
│       │   │   ├── default_constructor.md
│       │   │   ├── delegating_constructor.md
│       │   │   ├── encapsulation.md
│       │   │   ├── explicit_constructor.md
│       │   │   ├── forward_declaration.md
│       │   │   ├── friend.md
│       │   │   ├── implementation.md
│       │   │   ├── incomplete_type.md
│       │   │   ├── interface.md
│       │   │   ├── member_function.md
│       │   │   ├── mutable_data_member.md
│       │   │   ├── name_lookup.md
│       │   │   ├── private_member.md
│       │   │   ├── public_member.md
│       │   │   ├── synthesized_default_constructor.md
│       │   │   └── this_pointer.md
│       │   ├── ch08/
│       │   │   ├── condition_state.md
│       │   │   ├── file_mode.md
│       │   │   ├── file_stream.md
│       │   │   ├── fstream.md
│       │   │   ├── ifstream.md
│       │   │   ├── inheritance.md
│       │   │   ├── istringstream.md
│       │   │   ├── ofstream.md
│       │   │   └── string_stream.md
│       │   ├── ch09/
│       │   │   ├── adaptor.md
│       │   │   ├── array.md
│       │   │   ├── begin.md
│       │   │   ├── cbegin.md
│       │   │   ├── cend.md
│       │   │   ├── container.md
│       │   │   ├── deque.md
│       │   │   ├── end.md
│       │   │   ├── forward_list.md
│       │   │   ├── iterator_range.md
│       │   │   ├── left-inclusive_interval.md
│       │   │   ├── list.md
│       │   │   ├── off-the-beginning_iterator.md
│       │   │   ├── off-the-end_iterator.md
│       │   │   ├── priority_queue.md
│       │   │   ├── queue.md
│       │   │   ├── sequential_container.md
│       │   │   ├── stack.md
│       │   │   └── vector.md
│       │   ├── ch10/
│       │   │   ├── back_inserter.md
│       │   │   ├── bidirectional_iterator.md
│       │   │   ├── binary_predicate.md
│       │   │   ├── bind.md
│       │   │   ├── callable_object.md
│       │   │   ├── capture_list.md
│       │   │   ├── cref.md
│       │   │   ├── forward_iterator.md
│       │   │   ├── front_insertor.md
│       │   │   ├── generic_algorithm.md
│       │   │   ├── input_iterator.md
│       │   │   ├── insert_iterator.md
│       │   │   ├── inserter.md
│       │   │   ├── istream_iterator.md
│       │   │   ├── iterator_category.md
│       │   │   ├── lambda_expression.md
│       │   │   ├── move_iterator.md
│       │   │   ├── ostream_iterator.md
│       │   │   ├── output_iterator.md
│       │   │   ├── predicate.md
│       │   │   ├── random-access_iterator.md
│       │   │   ├── ref.md
│       │   │   ├── reverse_iterator.md
│       │   │   ├── stream_iterator.md
│       │   │   └── unary_predicate.md
│       │   ├── ch11/
│       │   │   ├── associative_array.md
│       │   │   ├── associative_container.md
│       │   │   ├── hash.md
│       │   │   ├── hash_function.md
│       │   │   ├── key_type.md
│       │   │   ├── map.md
│       │   │   ├── mapped_type.md
│       │   │   ├── multimap.md
│       │   │   ├── multiset.md
│       │   │   ├── pair.md
│       │   │   ├── set.md
│       │   │   ├── strict_weak_ordering.md
│       │   │   ├── unordered_container.md
│       │   │   ├── unordered_map.md
│       │   │   ├── unordered_multimap.md
│       │   │   ├── unordered_multiset.md
│       │   │   ├── unordered_set.md
│       │   │   └── value_type.md
│       │   ├── ch12/
│       │   │   ├── allocator.md
│       │   │   ├── dangling_pointer.md
│       │   │   ├── delete.md
│       │   │   ├── deleter.md
│       │   │   ├── destructor.md
│       │   │   ├── dynamically_allocated.md
│       │   │   ├── free_store.md
│       │   │   ├── heap.md
│       │   │   ├── new.md
│       │   │   ├── placement_new.md
│       │   │   ├── reference_count.md
│       │   │   ├── shared_ptr.md
│       │   │   ├── smart_pointer.md
│       │   │   ├── unique_ptr.md
│       │   │   └── weak_ptr.md
│       │   ├── ch13/
│       │   │   ├── copy-assignment_operator.md
│       │   │   ├── copy_and_swap.md
│       │   │   ├── copy_constructor.md
│       │   │   ├── copy_control.md
│       │   │   ├── copy_initialization.md
│       │   │   ├── deleted_function.md
│       │   │   ├── destructor.md
│       │   │   ├── lvalue_reference.md
│       │   │   ├── memberwise_copy_assign.md
│       │   │   ├── move-assignment_operator.md
│       │   │   ├── move.md
│       │   │   ├── move_constructor.md
│       │   │   ├── overload_operator.md
│       │   │   ├── reference_count.md
│       │   │   ├── reference_qualifier.md
│       │   │   ├── rvalue_reference.md
│       │   │   ├── synthesized_assignment_operator.md
│       │   │   ├── synthesized_copy_move_constructor.md
│       │   │   └── synthesized_destructor.md
│       │   ├── ch14/
│       │   │   ├── call_signature.md
│       │   │   ├── class-type_conversion.md
│       │   │   ├── conversion_operator.md
│       │   │   ├── explicit_conversion_operator.md
│       │   │   ├── function_object.md
│       │   │   ├── function_table.md
│       │   │   ├── function_template.md
│       │   │   ├── overloaded_operator.md
│       │   │   └── user-defined_conversion.md
│       │   ├── ch15/
│       │   │   ├── abstract_base_class.md
│       │   │   ├── accessible.md
│       │   │   ├── base_class.md
│       │   │   ├── class_derivation_list.md
│       │   │   ├── derived-to-base_conversion.md
│       │   │   ├── derived_class.md
│       │   │   ├── direct_base_class.md
│       │   │   ├── dynamic_binding.md
│       │   │   ├── dynamic_type.md
│       │   │   ├── indirect_base_class.md
│       │   │   ├── inheritance.md
│       │   │   ├── object-oriented_programming.md
│       │   │   ├── override.md
│       │   │   ├── polymorphism.md
│       │   │   ├── private_inheritance.md
│       │   │   ├── protected_access_specifier.md
│       │   │   ├── protected_inheritance.md
│       │   │   ├── public_inheritance.md
│       │   │   ├── pure_virtual.md
│       │   │   ├── refactoring.md
│       │   │   ├── run-time_binding.md
│       │   │   ├── sliced_down.md
│       │   │   ├── static_type.md
│       │   │   └── virtual_function.md
│       │   ├── ch16/
│       │   │   ├── class_template.md
│       │   │   ├── default_template_argument.md
│       │   │   ├── explicit_instantiation.md
│       │   │   ├── explicit_template_argument.md
│       │   │   ├── function_parameter_pack.md
│       │   │   ├── function_template.md
│       │   │   ├── instantiate.md
│       │   │   ├── instantiation.md
│       │   │   ├── member_template.md
│       │   │   ├── nontype_parameter.md
│       │   │   ├── pack_expansion.md
│       │   │   ├── parameter_pack.md
│       │   │   ├── partial_specialization.md
│       │   │   ├── pattern.md
│       │   │   ├── template_argument.md
│       │   │   ├── template_argument_deduction.md
│       │   │   ├── template_parameter.md
│       │   │   ├── template_parameter_list.md
│       │   │   ├── template_parameter_pack.md
│       │   │   ├── template_specialization.md
│       │   │   ├── type_parameter.md
│       │   │   ├── type_transformation.md
│       │   │   └── variadic_template.md
│       │   ├── ch17/
│       │   │   ├── bitset.md
│       │   │   ├── cmatch.md
│       │   │   ├── cregex_iterator.md
│       │   │   ├── csub_match.md
│       │   │   ├── default_random_engine.md
│       │   │   ├── formatted_IO.md
│       │   │   ├── get.md
│       │   │   ├── high-order.md
│       │   │   ├── low-order.md
│       │   │   ├── manipulator.md
│       │   │   ├── random-number_distribution.md
│       │   │   ├── random-number_engine.md
│       │   │   ├── random-number_generator.md
│       │   │   ├── regex.md
│       │   │   ├── regex_error.md
│       │   │   ├── regex_match.md
│       │   │   ├── regex_replace.md
│       │   │   ├── regex_search.md
│       │   │   ├── regular_expression.md
│       │   │   ├── seed.md
│       │   │   ├── smatch.md
│       │   │   ├── sregex_iterator.md
│       │   │   ├── ssub_match.md
│       │   │   ├── subexpression.md
│       │   │   ├── tuple.md
│       │   │   └── unformatted_IO.md
│       │   ├── ch18/
│       │   │   ├── catch-all.md
│       │   │   ├── catch_clause.md
│       │   │   ├── constructor_order.md
│       │   │   ├── exception_declaration.md
│       │   │   ├── exception_handling.md
│       │   │   ├── exception_object.md
│       │   │   ├── file_static.md
│       │   │   ├── function_try_block.md
│       │   │   ├── global_namespace.md
│       │   │   ├── handler.md
│       │   │   ├── inline_namespace.md
│       │   │   ├── multiple_inheritance.md
│       │   │   ├── namespace.md
│       │   │   ├── namespace_alias.md
│       │   │   ├── namespace_pollution.md
│       │   │   ├── noexcept_operator.md
│       │   │   ├── noexcept_specification.md
│       │   │   ├── nonthrowing_specification.md
│       │   │   ├── raise.md
│       │   │   ├── rethrow.md
│       │   │   ├── stack_unwinding.md
│       │   │   ├── terminate.md
│       │   │   ├── throw.md
│       │   │   ├── try_block.md
│       │   │   ├── unnamed_namespace.md
│       │   │   ├── using_declaration.md
│       │   │   ├── using_directive.md
│       │   │   ├── virtual_base_class.md
│       │   │   └── virtual_inheritance.md
│       │   ├── ch19/
│       │   │   ├── anonymous_union.md
│       │   │   ├── bit-field.md
│       │   │   ├── discriminant.md
│       │   │   ├── dynamic_cast.md
│       │   │   ├── enumeration.md
│       │   │   ├── enumerator.md
│       │   │   ├── free.md
│       │   │   ├── link_directive.md
│       │   │   ├── local_class.md
│       │   │   ├── malloc.md
│       │   │   ├── mem_fn.md
│       │   │   ├── nested_class.md
│       │   │   ├── nested_type.md
│       │   │   ├── nonportable.md
│       │   │   ├── operator_delete.md
│       │   │   ├── operator_new.md
│       │   │   ├── placement_new_expression.md
│       │   │   ├── pointer_to_member.md
│       │   │   ├── run-time_tyoe_identification.md
│       │   │   ├── scoped_enumeration.md
│       │   │   ├── typeid_operator.md
│       │   │   ├── typeinfo.md
│       │   │   ├── union.md
│       │   │   ├── unscoped_enumeration.md
│       │   │   └── volatile.md
│       │   ├── gen_index.sh
│       │   └── terms_index.md
│       └── gen_readme.sh
├── mkdocs.yml
└── notes/
    ├── CProgramming/
    │   ├── ch01 C语言概述.md
    │   ├── ch02 C语言基本概念.md
    │   ├── ch03 格式化输入输出.md
    │   ├── ch04 表达式.md
    │   ├── ch05 选择语句.md
    │   ├── ch06 循环.md
    │   ├── ch07 基本类型.md
    │   ├── ch08 数组.md
    │   ├── ch09 函数.md
    │   ├── ch10 程序结构.md
    │   ├── ch11 指针.md
    │   ├── ch12 指针和数组.md
    │   ├── ch13 字符串.md
    │   ├── ch14 预处理器.md
    │   ├── ch15 编写大规模程序.md
    │   ├── ch16 结构、联合和枚举.md
    │   ├── ch17 指针的高级应用.md
    │   ├── ch18 声明.md
    │   ├── ch19 程序设计.md
    │   ├── ch20 低级程序设计.md
    │   ├── ch21 标准库.md
    │   ├── ch22 输入_输出.md
    │   ├── ch23 库对数值和字符数据的支持.md
    │   ├── ch24 错误处理.md
    │   ├── ch25 国际化特性.md
    │   ├── ch26 其他库函数.md
    │   └── cheatsheet/
    │       └── 惯用法.md
    ├── CppPrimer/
    │   ├── ch01 开始.md
    │   ├── ch02 变量和基本类型.md
    │   ├── ch03 字符串、向量和数组.md
    │   ├── ch04 表达式.md
    │   ├── ch05 语句.md
    │   ├── ch06 函数.md
    │   ├── ch07 类.md
    │   ├── ch08 IO库.md
    │   ├── ch09 顺序容器.md
    │   ├── ch10 泛型算法.md
    │   ├── ch11 关联容器.md
    │   ├── ch12 动态内存.md
    │   ├── ch13 拷贝控制.md
    │   ├── ch14 操作重载与类型转换.md
    │   ├── ch15 面向对象程序设计.md
    │   ├── ch16 模板与泛型编程.md
    │   ├── ch17 标准库特殊设施.md
    │   ├── ch18 用于大型程序的工具.md
    │   └── ch19 特殊工具与技术.md
    ├── EffectiveModernCpp/
    │   ├── ch01_型别推导/
    │   │   ├── 条款1_理解模板型别推导.md
    │   │   ├── 条款2_理解auto型别推导.md
    │   │   ├── 条款3_理解decltype.md
    │   │   └── 条款4_掌握查看型别推导结果的方法.md
    │   └── ch02_auto/
    │       ├── 条款5_优先选用auto而非显式型别声明.md
    │       └── 条款6_当auto推导的型别不符合要求时使用带显式型别的初始化物习惯用法.md
    └── index.md
Download .txt
Showing preview only (202K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (2379 symbols across 905 files)

FILE: codes/CProgramming/ch02_C语言基本概念/celsius.c
  function main (line 8) | int main()

FILE: codes/CProgramming/ch02_C语言基本概念/dweight.c
  function main (line 5) | int main()

FILE: codes/CProgramming/ch02_C语言基本概念/dweight2.c
  function main (line 5) | int main()

FILE: codes/CProgramming/ch02_C语言基本概念/ex_01.c
  function main (line 22) | int main()

FILE: codes/CProgramming/ch02_C语言基本概念/ex_02.c
  function main (line 29) | int main()

FILE: codes/CProgramming/ch02_C语言基本概念/ex_03.c
  function main (line 14) | int main()

FILE: codes/CProgramming/ch02_C语言基本概念/ex_04.c
  function main (line 10) | int main()

FILE: codes/CProgramming/ch02_C语言基本概念/ex_05.c
  function main (line 14) | int main()

FILE: codes/CProgramming/ch02_C语言基本概念/ex_06.c
  function main (line 12) | int main()

FILE: codes/CProgramming/ch02_C语言基本概念/ex_07.c
  function main (line 9) | int main()

FILE: codes/CProgramming/ch02_C语言基本概念/ex_08.c
  function main (line 11) | int main()

FILE: codes/CProgramming/ch02_C语言基本概念/ex_10.c
  function main (line 9) | int main()

FILE: codes/CProgramming/ch02_C语言基本概念/pun.c
  function main (line 10) | int main()

FILE: codes/CProgramming/ch03_格式化的输入输出/addfrac.c
  function main (line 5) | int main()

FILE: codes/CProgramming/ch03_格式化的输入输出/ex_01.c
  function main (line 7) | int main()

FILE: codes/CProgramming/ch03_格式化的输入输出/ex_02.c
  function main (line 7) | int main()

FILE: codes/CProgramming/ch03_格式化的输入输出/ex_03.c
  function main (line 7) | int main()

FILE: codes/CProgramming/ch03_格式化的输入输出/ex_04.c
  function main (line 10) | int main()

FILE: codes/CProgramming/ch03_格式化的输入输出/ex_05.c
  function main (line 16) | int main()

FILE: codes/CProgramming/ch03_格式化的输入输出/ex_06.c
  function main (line 16) | int main()

FILE: codes/CProgramming/ch03_格式化的输入输出/ex_07.c
  function main (line 11) | int main()

FILE: codes/CProgramming/ch03_格式化的输入输出/ex_08.c
  function main (line 11) | int main()

FILE: codes/CProgramming/ch03_格式化的输入输出/example_escape_sequence.c
  function main (line 7) | int main()

FILE: codes/CProgramming/ch03_格式化的输入输出/example_scanf.c
  function main (line 7) | int main()

FILE: codes/CProgramming/ch03_格式化的输入输出/stocks.c
  function main (line 7) | int main()

FILE: codes/CProgramming/ch03_格式化的输入输出/tprintf.c
  function main (line 5) | int main()

FILE: codes/CProgramming/ch04_表达式/ex_01.c
  function main (line 7) | int main()

FILE: codes/CProgramming/ch04_表达式/ex_02.c
  function main (line 9) | int main()

FILE: codes/CProgramming/ch04_表达式/ex_03.c
  function main (line 11) | int main()

FILE: codes/CProgramming/ch04_表达式/ex_04.c
  function main (line 7) | int main()

FILE: codes/CProgramming/ch04_表达式/ex_05.c
  function main (line 8) | int main()

FILE: codes/CProgramming/ch04_表达式/ex_06.c
  function main (line 7) | int main()

FILE: codes/CProgramming/ch04_表达式/ex_07.c
  function main (line 7) | int main()

FILE: codes/CProgramming/ch04_表达式/ex_08.c
  function main (line 9) | int main()

FILE: codes/CProgramming/ch04_表达式/ex_10.c
  function main (line 14) | int main()

FILE: codes/CProgramming/ch04_表达式/upc.c
  function main (line 9) | int main()

FILE: codes/CProgramming/ch05_选择语句/broker.c
  function main (line 5) | int main()

FILE: codes/CProgramming/ch05_选择语句/date.c
  function main (line 7) | int main()

FILE: codes/CProgramming/ch05_选择语句/ex_01.c
  function main (line 8) | int main()

FILE: codes/CProgramming/ch05_选择语句/ex_02.c
  function main (line 7) | int main()

FILE: codes/CProgramming/ch05_选择语句/ex_03.c
  function main (line 8) | int main()

FILE: codes/CProgramming/ch05_选择语句/ex_04.c
  function main (line 7) | int main()

FILE: codes/CProgramming/ch05_选择语句/ex_05.c
  function main (line 13) | int main()

FILE: codes/CProgramming/ch05_选择语句/ex_06.c
  function main (line 12) | int main()

FILE: codes/CProgramming/ch05_选择语句/ex_07.c
  function main (line 11) | int main()

FILE: codes/CProgramming/ch05_选择语句/ex_08.c
  function main (line 17) | int main()

FILE: codes/CProgramming/ch05_选择语句/ex_09.c
  function main (line 19) | int main()

FILE: codes/CProgramming/ch05_选择语句/ex_10.c
  function main (line 12) | int main()

FILE: codes/CProgramming/ch05_选择语句/ex_11.c
  function main (line 16) | int main()

FILE: codes/CProgramming/ch05_选择语句/ex_12.c
  function main (line 15) | int main()

FILE: codes/CProgramming/ch05_选择语句/ex_13.c
  function main (line 14) | int main()

FILE: codes/CProgramming/ch05_选择语句/ex_14.c
  function main (line 14) | int main()

FILE: codes/CProgramming/ch05_选择语句/ex_15.c
  function main (line 13) | int main()

FILE: codes/CProgramming/ch05_选择语句/ex_16.c
  function main (line 11) | int main()

FILE: codes/CProgramming/ch06_循环/checking.c
  function main (line 5) | int main()

FILE: codes/CProgramming/ch06_循环/ex_01.c
  function main (line 16) | int main()

FILE: codes/CProgramming/ch06_循环/ex_02.c
  function main (line 14) | int main()

FILE: codes/CProgramming/ch06_循环/ex_03.c
  function main (line 13) | int main()

FILE: codes/CProgramming/ch06_循环/ex_04.c
  function main (line 14) | int main()

FILE: codes/CProgramming/ch06_循环/ex_05.c
  function main (line 7) | int main()

FILE: codes/CProgramming/ch06_循环/ex_06.c
  function main (line 14) | int main()

FILE: codes/CProgramming/ch06_循环/ex_07.c
  function main (line 8) | int main()

FILE: codes/CProgramming/ch06_循环/ex_08.c
  function main (line 20) | int main()

FILE: codes/CProgramming/ch06_循环/ex_09.c
  function main (line 20) | int main()

FILE: codes/CProgramming/ch06_循环/ex_12.c
  function main (line 7) | int main()

FILE: codes/CProgramming/ch06_循环/ex_13.c
  function main (line 18) | int main()

FILE: codes/CProgramming/ch06_循环/ex_14.c
  function main (line 14) | int main()

FILE: codes/CProgramming/ch06_循环/ex_15.c
  function main (line 10) | int main()

FILE: codes/CProgramming/ch06_循环/example_goto.c
  function main (line 8) | int main()

FILE: codes/CProgramming/ch06_循环/numdigit.c
  function main (line 5) | int main()

FILE: codes/CProgramming/ch06_循环/square.c
  function main (line 5) | int main(void)

FILE: codes/CProgramming/ch06_循环/square2.c
  function main (line 5) | int main()

FILE: codes/CProgramming/ch06_循环/square3.c
  function main (line 5) | int main()

FILE: codes/CProgramming/ch06_循环/sum.c
  function main (line 5) | int main()

FILE: codes/CProgramming/ch07_基本类型/ex_01.c
  function main (line 11) | int main()

FILE: codes/CProgramming/ch07_基本类型/ex_02.c
  function main (line 18) | int main()

FILE: codes/CProgramming/ch07_基本类型/ex_03.c
  function main (line 13) | int main()

FILE: codes/CProgramming/ch07_基本类型/ex_04.c
  function main (line 10) | int main()

FILE: codes/CProgramming/ch07_基本类型/ex_05.c
  function main (line 7) | int main()

FILE: codes/CProgramming/ch07_基本类型/ex_06.c
  function main (line 12) | int main()

FILE: codes/CProgramming/ch07_基本类型/ex_08.c
  function main (line 10) | int main()

FILE: codes/CProgramming/ch07_基本类型/ex_09.c
  function main (line 17) | int main()

FILE: codes/CProgramming/ch07_基本类型/ex_10.c
  function main (line 14) | int main()

FILE: codes/CProgramming/ch07_基本类型/ex_11.c
  function main (line 18) | int main()

FILE: codes/CProgramming/ch07_基本类型/ex_12.c
  function main (line 8) | int main()

FILE: codes/CProgramming/ch07_基本类型/ex_17.c
  function main (line 23) | int main()

FILE: codes/CProgramming/ch07_基本类型/ex_19.c
  type Int8 (line 12) | typedef char Int8;
  type Int16 (line 13) | typedef short Int16;
  type Int32 (line 14) | typedef int Int32;
  function main (line 16) | int main()

FILE: codes/CProgramming/ch07_基本类型/length.c
  function skips_rest_line (line 6) | int skips_rest_line()
  function main (line 17) | int main()

FILE: codes/CProgramming/ch07_基本类型/mytoupper.c
  function my_toupper (line 5) | char my_toupper(char c)
  function main (line 15) | int main()

FILE: codes/CProgramming/ch07_基本类型/scanf_char.c
  function main (line 5) | int main()

FILE: codes/CProgramming/ch07_基本类型/sum2.c
  function main (line 9) | int main()

FILE: codes/CProgramming/ch07_基本类型/typedef_sizeof.c
  function main (line 7) | int main()

FILE: codes/CProgramming/ch08_数组/deal.c
  function main (line 11) | int main()

FILE: codes/CProgramming/ch08_数组/ex_01.c
  type Bool (line 19) | typedef int Bool;
  function main (line 21) | int main()

FILE: codes/CProgramming/ch08_数组/ex_02.c
  type Bool (line 21) | typedef int Bool;
  function main (line 23) | int main()

FILE: codes/CProgramming/ch08_数组/ex_03.c
  type Bool (line 20) | typedef int Bool;
  function main (line 22) | int main()

FILE: codes/CProgramming/ch08_数组/ex_05.c
  function main (line 20) | int main()

FILE: codes/CProgramming/ch08_数组/ex_06.c
  function main (line 13) | int main()

FILE: codes/CProgramming/ch08_数组/ex_07.c
  function main (line 21) | int main()

FILE: codes/CProgramming/ch08_数组/ex_09.c
  function main (line 20) | int main()

FILE: codes/CProgramming/ch08_数组/ex_10.c
  function main (line 24) | int main()

FILE: codes/CProgramming/ch08_数组/ex_11.c
  function main (line 17) | int main()

FILE: codes/CProgramming/ch08_数组/ex_12.c
  function main (line 22) | int main()

FILE: codes/CProgramming/ch08_数组/ex_13.c
  function main (line 9) | int main()

FILE: codes/CProgramming/ch08_数组/interest.c
  function main (line 8) | int main()

FILE: codes/CProgramming/ch08_数组/repdigit.c
  type Bool (line 15) | typedef int Bool;
  function main (line 17) | int main()

FILE: codes/CProgramming/ch08_数组/reverse.c
  function main (line 14) | int main()

FILE: codes/CProgramming/ch09_函数/average.c
  function average (line 5) | double average(double a, double b)
  function main (line 10) | int main()

FILE: codes/CProgramming/ch09_函数/countdown.c
  function print_count (line 5) | void print_count(int n)
  function main (line 10) | int main()

FILE: codes/CProgramming/ch09_函数/ex_01.c
  function triangle_area (line 20) | float triangle_area(float base, float height)
  function main (line 27) | int main()

FILE: codes/CProgramming/ch09_函数/ex_02.c
  function check (line 8) | int check(int x, int y, int n)
  function main (line 15) | int main()

FILE: codes/CProgramming/ch09_函数/ex_03.c
  function gcd (line 18) | int gcd(int m, int n)
  function main (line 31) | int main()

FILE: codes/CProgramming/ch09_函数/ex_04.c
  type Bool (line 11) | typedef int Bool;
  function Bool (line 13) | Bool is_leap_year(int year)
  function day_of_year (line 20) | int day_of_year(int month, int day, int year)
  function main (line 41) | int main()

FILE: codes/CProgramming/ch09_函数/ex_05.c
  function num_digits (line 8) | int num_digits(n)
  function main (line 19) | int main()

FILE: codes/CProgramming/ch09_函数/ex_06.c
  function digit (line 9) | int digit(int n, int k)
  function main (line 26) | int main()

FILE: codes/CProgramming/ch09_函数/ex_07.c
  function f (line 9) | int f(int a, int b) { return 0; }
  function main (line 11) | int main()

FILE: codes/CProgramming/ch09_函数/ex_09.c
  function main (line 13) | int main()
  function swap (line 23) | void swap(int a, int b)

FILE: codes/CProgramming/ch09_函数/ex_10.c
  function main (line 18) | int main()
  function array_max_element (line 29) | int array_max_element(int array[], int count)
  function array_average (line 41) | int array_average(int array[], int count)
  function array_positive_count (line 53) | int array_positive_count(int array[], int count)

FILE: codes/CProgramming/ch09_函数/ex_12.c
  function median (line 19) | float median(float x, float y, float z)
  function main (line 35) | int main()

FILE: codes/CProgramming/ch09_函数/ex_13.c
  function fact (line 7) | int fact(int n)
  function main (line 12) | int main()

FILE: codes/CProgramming/ch09_函数/ex_14.c
  function fact (line 7) | int fact(int n)
  function main (line 18) | int main()

FILE: codes/CProgramming/ch09_函数/ex_15.c
  function gcd (line 9) | int gcd(int m, int n)
  function main (line 14) | int main()

FILE: codes/CProgramming/ch09_函数/ex_16.c
  function pb (line 20) | void pb(int n)
  function main (line 28) | int main()

FILE: codes/CProgramming/ch09_函数/ex_17.c
  function selection_sort (line 12) | void selection_sort(int array[], int count)
  function main (line 32) | int main()

FILE: codes/CProgramming/ch09_函数/prime.c
  function is_prime (line 5) | int is_prime(int n)
  function main (line 22) | int main()

FILE: codes/CProgramming/ch09_函数/pun2.c
  function print_pun (line 5) | void print_pun(void)
  function main (line 10) | int main()

FILE: codes/CProgramming/ch09_函数/qsort.c
  function main (line 10) | int main()
  function quicksort (line 32) | void quicksort(int a[], int low, int high)
  function split (line 43) | int split(int a[], int low, int high)

FILE: codes/CProgramming/ch10_程序结构/ex_01.c
  function make_empty (line 21) | void make_empty()
  function is_empty (line 26) | int is_empty()
  function is_full (line 31) | int is_full()
  function push (line 36) | void push(int i)
  function pop (line 44) | int pop()
  function main (line 56) | int main()

FILE: codes/CProgramming/ch10_程序结构/ex_03.c
  type Bool (line 19) | typedef int Bool;
  function main (line 32) | int main()
  function read_cards (line 51) | void read_cards(int num_in_rank[], int num_in_suit[])
  function analyze_hand (line 128) | void analyze_hand(int num_in_rank[], int num_in_suit[])
  function print_result (line 168) | void print_result()

FILE: codes/CProgramming/ch10_程序结构/ex_04.c
  type Bool (line 19) | typedef int Bool;
  function main (line 35) | int main()
  function sort_by_rank (line 49) | void sort_by_rank(int cards[][2], int count)
  function Bool (line 75) | Bool card_exists(int cards[][2], int count, int rank, int suit)
  function read_cards (line 92) | void read_cards(void)
  function analyze_hand (line 162) | void analyze_hand()
  function print_result (line 211) | void print_result()

FILE: codes/CProgramming/ch10_程序结构/ex_05.c
  type Bool (line 19) | typedef int Bool;
  function main (line 35) | int main()
  function sort_by_rank (line 49) | void sort_by_rank(int cards[][2], int count)
  function Bool (line 75) | Bool card_exists(int cards[][2], int count, int rank, int suit)
  function read_cards (line 92) | void read_cards(void)
  function analyze_hand (line 162) | void analyze_hand()
  function print_result (line 218) | void print_result()

FILE: codes/CProgramming/ch10_程序结构/ex_06.c
  type Bool (line 18) | typedef int Bool;
  function main (line 34) | int main()
  function sort_by_rank (line 48) | void sort_by_rank(int cards[][2], int count)
  function Bool (line 74) | Bool card_exists(int cards[][2], int count, int rank, int suit)
  function read_cards (line 91) | void read_cards(void)
  function analyze_hand (line 161) | void analyze_hand()
  function print_result (line 220) | void print_result()

FILE: codes/CProgramming/ch10_程序结构/ex_07.c
  function main (line 14) | int main()

FILE: codes/CProgramming/ch10_程序结构/guess.c
  function main (line 13) | int main()
  function new_secret_number (line 42) | int new_secret_number()
  function read_guesses (line 50) | void read_guesses(int secret_number)

FILE: codes/CProgramming/ch10_程序结构/poker.c
  type Bool (line 14) | typedef int Bool;
  function main (line 29) | int main()
  function read_cards (line 45) | void read_cards(void)
  function analyze_hand (line 122) | void analyze_hand()
  function print_result (line 162) | void print_result()

FILE: codes/CProgramming/ch10_程序结构/stack.c
  function make_empty (line 9) | void make_empty()
  function is_empty (line 14) | int is_empty()
  function is_full (line 19) | int is_full()
  function push (line 24) | void push(int i)
  function pop (line 32) | int pop()
  function main (line 44) | int main()

FILE: codes/CProgramming/ch11_指针/ex_03.c
  function avg_sum (line 18) | void avg_sum(float a[], int n, float *avg, float *sum)
  function main (line 28) | int main()

FILE: codes/CProgramming/ch11_指针/ex_04.c
  function main (line 17) | int main()
  function swap (line 27) | void swap(int *a, int *b)

FILE: codes/CProgramming/ch11_指针/ex_05.c
  function main (line 15) | int main()
  function split_time (line 30) | void split_time(long int total_sec, int *hr, int *min, int *sec)

FILE: codes/CProgramming/ch11_指针/ex_06.c
  function main (line 14) | int main()
  function find_two_largest (line 26) | void find_two_largest(int a[], int n, int *largest, int *second_largest)

FILE: codes/CProgramming/ch11_指针/maxmin.c
  function main (line 11) | int main()
  function max_min (line 27) | void max_min(int a[], int n, int *max, int *min)

FILE: codes/CProgramming/ch12_指针和数组/ex_01.c
  function main (line 20) | int main()

FILE: codes/CProgramming/ch12_指针和数组/ex_03.c
  function main (line 13) | int main()

FILE: codes/CProgramming/ch12_指针和数组/ex_04.c
  function solution_a (line 17) | void solution_a()
  function solution_b (line 36) | void solution_b()
  function main (line 55) | int main()

FILE: codes/CProgramming/ch12_指针和数组/ex_05.c
  function solution_a (line 20) | void solution_a()
  function solution_b (line 51) | void solution_b()
  function main (line 82) | int main()

FILE: codes/CProgramming/ch12_指针和数组/ex_06.c
  function make_empty (line 14) | void make_empty()
  function is_empty (line 19) | int is_empty()
  function is_full (line 24) | int is_full()
  function push (line 29) | void push(int i)
  function pop (line 37) | int pop()
  function main (line 49) | int main()

FILE: codes/CProgramming/ch12_指针和数组/ex_10.c
  function sum_array (line 18) | int sum_array(int a[], int n)
  function main (line 27) | int main()

FILE: codes/CProgramming/ch12_指针和数组/ex_11.c
  type Bool (line 15) | typedef int Bool;
  function Bool (line 17) | Bool search(int a[], int n, int key)
  function main (line 27) | int main()

FILE: codes/CProgramming/ch12_指针和数组/ex_12.c
  function print (line 13) | void print(float ident[][N], int count)
  function book_version (line 24) | void book_version()
  function ex_version (line 39) | void ex_version()
  function main (line 57) | int main()

FILE: codes/CProgramming/ch12_指针和数组/ex_13.c
  type Bool (line 16) | typedef int Bool;
  function Bool (line 18) | Bool search(int a[], int n, int key)
  function main (line 28) | int main()

FILE: codes/CProgramming/ch12_指针和数组/ex_14.c
  type Bool (line 13) | typedef int Bool;
  function Bool (line 15) | Bool search(int a[], int n, int key)
  function main (line 25) | int main()

FILE: codes/CProgramming/ch12_指针和数组/ex_15.c
  function find_largest (line 8) | int find_largest(int a[], int count)
  function main (line 21) | int main()

FILE: codes/CProgramming/ch12_指针和数组/reverse2.c
  function main (line 11) | int main()

FILE: codes/CProgramming/ch13_字符串/count_space.c
  function count_space (line 7) | int count_space(const char *s)
  function main (line 16) | int main()

FILE: codes/CProgramming/ch13_字符串/ex_03.c
  function main (line 16) | int main()

FILE: codes/CProgramming/ch13_字符串/ex_04.c
  function read_line (line 15) | int read_line(char str[], int n)
  function main (line 41) | int main()

FILE: codes/CProgramming/ch13_字符串/ex_05.c
  function main (line 36) | int main()

FILE: codes/CProgramming/ch13_字符串/ex_06.c
  function read_line (line 30) | int read_line(char str[], int n)
  function main (line 44) | int main()

FILE: codes/CProgramming/ch13_字符串/ex_07.c
  function main (line 22) | int main()

FILE: codes/CProgramming/ch13_字符串/ex_08.c
  function f (line 29) | int f(char *s, char *t)
  function main (line 40) | int main()

FILE: codes/CProgramming/ch13_字符串/ex_10.c
  function main (line 16) | int main()

FILE: codes/CProgramming/ch13_字符串/ex_11.c
  function main (line 21) | int main()

FILE: codes/CProgramming/ch13_字符串/ex_13.c
  function strcmp_ (line 8) | int strcmp_(char *s, char *t)
  function main (line 20) | int main()

FILE: codes/CProgramming/ch13_字符串/ex_14.c
  function main (line 27) | int main()

FILE: codes/CProgramming/ch13_字符串/ex_15.c
  function main (line 30) | int main()
  function read_line (line 77) | int read_line(char str[], int n)

FILE: codes/CProgramming/ch13_字符串/ex_16.c
  function count_space (line 11) | int count_space(const char *s)
  function main (line 20) | int main()

FILE: codes/CProgramming/ch13_字符串/ex_17.c
  function main (line 25) | int main()

FILE: codes/CProgramming/ch13_字符串/ex_19.c
  function main (line 16) | int main(int argc, char* argv[])

FILE: codes/CProgramming/ch13_字符串/ex_20.c
  function ToUpper (line 17) | void ToUpper(const char* s, char *out)
  function main (line 24) | int main(int argc, char *argv[])

FILE: codes/CProgramming/ch13_字符串/planet.c
  function main (line 12) | int main(int argc, char *argv[])

FILE: codes/CProgramming/ch13_字符串/read_line.c
  function read_line (line 9) | int read_line(char str[], int n)
  function main (line 23) | int main()

FILE: codes/CProgramming/ch13_字符串/remind.c
  function main (line 15) | int main()
  function read_line (line 53) | int read_line(char str[], int n)

FILE: codes/CProgramming/ch13_字符串/reverse.c
  function main (line 13) | int main(int argc, char* argv[])

FILE: codes/CProgramming/ch13_字符串/strcat.c
  function main (line 17) | int main()

FILE: codes/CProgramming/ch13_字符串/strcmp.c
  function strcmp_ (line 7) | int strcmp_(char *s, char *t)
  function main (line 17) | int main()

FILE: codes/CProgramming/ch13_字符串/strlen.c
  function strlen_ (line 7) | size_t strlen_(const char *s)
  function main (line 16) | int main()

FILE: codes/CProgramming/ch14_预处理器/ex_01.c
  function main (line 14) | int main()

FILE: codes/CProgramming/ch14_预处理器/ex_02.c
  function main (line 9) | int main()

FILE: codes/CProgramming/ch14_预处理器/ex_03.c
  function main (line 21) | int main()

FILE: codes/CProgramming/ch14_预处理器/ex_04.c
  function main (line 16) | int main()

FILE: codes/CProgramming/ch14_预处理器/ex_05.c
  function main (line 18) | int main()

FILE: codes/CProgramming/ch14_预处理器/ex_06.c
  function main (line 29) | int main()

FILE: codes/CProgramming/ch14_预处理器/ex_07.c
  function sum (line 20) | double sum(double a, double b)
  function main (line 25) | int main()

FILE: codes/CProgramming/ch14_预处理器/ex_08.c
  type UIntLong (line 35) | typedef unsigned long UIntLong;
  function main (line 39) | int main()

FILE: codes/CProgramming/ch14_预处理器/ex_09.c
  function main (line 22) | int main()

FILE: codes/CProgramming/ch14_预处理器/ex_10.c
  function main (line 21) | int main()

FILE: codes/CProgramming/ch14_预处理器/ex_11.c
  function main (line 46) | int main()
  function f (line 55) | void f(void)

FILE: codes/CProgramming/ch14_预处理器/ex_12.c
  function main (line 44) | int main()

FILE: codes/CProgramming/ch15_编写大规模程序/dir_ex_04/bar.c
  function main (line 12) | int main()

FILE: codes/CProgramming/ch15_编写大规模程序/dir_ex_04/foo.c
  function Get (line 7) | int Get()

FILE: codes/CProgramming/ch15_编写大规模程序/dir_ex_06/main.c
  function main (line 14) | int main()

FILE: codes/CProgramming/ch15_编写大规模程序/dir_ex_06/stack.c
  function stack_make_empty (line 10) | void stack_make_empty()
  function stack_is_empty (line 15) | int stack_is_empty()
  function PRIVATE (line 20) | PRIVATE int stack_is_full()
  function stack_push (line 25) | void stack_push(int i)
  function stack_pop (line 32) | int stack_pop()

FILE: codes/CProgramming/ch15_编写大规模程序/dir_ex_06/token.c
  function get_last_number (line 9) | int get_last_number()
  function get_last_op (line 14) | char get_last_op()
  function TokenType (line 19) | TokenType next_token()

FILE: codes/CProgramming/ch15_编写大规模程序/dir_ex_06/token.h
  type TokenType (line 9) | typedef int TokenType;

FILE: codes/CProgramming/ch15_编写大规模程序/dir_ex_07/main.c
  function main (line 3) | int main()

FILE: codes/CProgramming/ch15_编写大规模程序/format_program/fmt.c
  function main (line 7) | int main()

FILE: codes/CProgramming/ch15_编写大规模程序/format_program/line.c
  function clear_line (line 11) | void clear_line(void)
  function add_word (line 18) | void add_word(const char *word)
  function space_remaining (line 31) | int space_remaining(void)
  function write_line (line 36) | void write_line(void)
  function write_line_ex5 (line 57) | void write_line_ex5(void)
  function flush_line (line 79) | void flush_line(void)

FILE: codes/CProgramming/ch15_编写大规模程序/format_program/word.c
  function read_char (line 5) | int read_char(void)
  function read_word (line 14) | void read_word(char *word, int len)
  function read_word_ex09 (line 28) | void read_word_ex09(char *word, int len)

FILE: codes/CProgramming/ch16_结构_联合_枚举/dir_ex_08/invent.c
  type part (line 12) | struct part {
  type part (line 18) | struct part
  type part (line 19) | struct part
  type part (line 20) | struct part
  type part (line 21) | struct part
  type part (line 22) | struct part
  function main (line 31) | int main(int argc, char const *argv[])
  function find_part (line 62) | int find_part(struct part inventory[MAX_PARTS], int num_parts, int number)
  function insert (line 79) | void insert(struct part inventory[MAX_PARTS], int *num_parts)
  function search (line 112) | void search(struct part inventory[MAX_PARTS], int num_parts)
  function update (line 134) | void update(struct part inventory[MAX_PARTS], int num_parts)
  function print (line 159) | void print(struct part inventory[MAX_PARTS], int num_parts)

FILE: codes/CProgramming/ch16_结构_联合_枚举/dir_ex_08/readline.c
  function read_line (line 5) | int read_line(char str[], int n)

FILE: codes/CProgramming/ch16_结构_联合_枚举/dir_ex_09/invent.c
  type part (line 12) | struct part {
  function main (line 35) | int main(int argc, char const *argv[])
  function find_part (line 64) | int find_part(int number)
  function insert (line 81) | void insert(void)
  function search (line 117) | void search(void)
  function update (line 140) | void update(void)
  function update_price (line 158) | void update_price(void)
  function print (line 183) | void print(void)

FILE: codes/CProgramming/ch16_结构_联合_枚举/dir_ex_09/readline.c
  function read_line (line 5) | int read_line(char str[], int n)

FILE: codes/CProgramming/ch16_结构_联合_枚举/ex_01.c
  function main (line 16) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch16_结构_联合_枚举/ex_02.c
  type complex (line 23) | typedef struct complex {
  function complex (line 27) | complex make_complex(double p1, double p2)
  function complex (line 34) | complex add_complex(complex c1, complex c2)
  function main (line 42) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch16_结构_联合_枚举/ex_05.c
  type point (line 18) | struct point
  type rectangle (line 22) | struct rectangle
  function GetArea (line 28) | int GetArea(struct rectangle r)
  function GetMidPoint (line 36) | struct point GetMidPoint(struct rectangle r)
  function move (line 45) | struct rectangle move(struct rectangle r, int x, int y)
  type Bool (line 57) | typedef enum
  function Bool (line 62) | Bool IsIn(struct rectangle r, struct point p)
  function main (line 68) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch16_结构_联合_枚举/ex_06.c
  type counry (line 17) | struct counry {
  function read_line (line 22) | int read_line(char str[], int n)
  function find (line 43) | int find(char *name)
  function insert (line 54) | void insert()
  function search (line 80) | void search()
  function main (line 95) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch16_结构_联合_枚举/ex_10.c
  type T (line 24) | struct T {
  function main (line 35) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch16_结构_联合_枚举/ex_11.c
  type point (line 29) | struct point {
  type shape (line 33) | struct shape {
  function main (line 47) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch16_结构_联合_枚举/ex_12.c
  type Bool (line 15) | typedef enum { TRUE, FALSE } Bool;
  type point (line 19) | struct point {
  type shape (line 23) | struct shape {
  type Point (line 37) | typedef struct point Point;
  type Shape (line 38) | typedef struct shape Shape;
  function Point (line 44) | Point GetCenter(const Shape* shape)
  function Move (line 50) | void Move(Shape* shape, int x, int y)
  function Bool (line 57) | Bool IsIn(const Shape* shape, Point p)
  function main (line 74) | int main(int argc, char const *argv[])
  function GetArea (line 95) | double GetArea(const Shape* shape)

FILE: codes/CProgramming/ch16_结构_联合_枚举/ex_14.c
  type WEEKDAY (line 11) | typedef enum { SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SAT...
  function main (line 13) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch16_结构_联合_枚举/ex_17.c
  type Piece (line 10) | typedef enum piece {
  type Color (line 20) | typedef enum color {
  type Square (line 26) | typedef struct square {
  function main (line 42) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch16_结构_联合_枚举/program_parts/invent.c
  type part (line 13) | struct part {
  function main (line 36) | int main(int argc, char const *argv[])
  function find_part (line 64) | int find_part(int number)
  function insert (line 81) | void insert(void)
  function search (line 114) | void search(void)
  function update (line 136) | void update(void)
  function print (line 161) | void print(void)
  function print_ex07 (line 170) | void print_ex07(void)
  function compare_parts (line 184) | int compare_parts(const void *p, const void *q)
  function print_ch17_ex16 (line 189) | void print_ch17_ex16(void)

FILE: codes/CProgramming/ch16_结构_联合_枚举/program_parts/readline.c
  function read_line (line 5) | int read_line(char str[], int n)

FILE: codes/CProgramming/ch17_指针的高级应用/dir_ex_04/invent.c
  type part (line 12) | struct part {
  type part (line 19) | struct part
  function main (line 36) | int main(int argc, char const *argv[])
  function find_part (line 71) | int find_part(int number)
  function insert (line 88) | void insert(void)
  function search (line 127) | void search(void)
  function update (line 149) | void update(void)
  function print (line 174) | void print(void)

FILE: codes/CProgramming/ch17_指针的高级应用/dir_ex_04/readline.c
  function read_line (line 5) | int read_line(char str[], int n)

FILE: codes/CProgramming/ch17_指针的高级应用/ex_01.c
  function main (line 14) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch17_指针的高级应用/ex_02.c
  function main (line 13) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch17_指针的高级应用/ex_03.c
  function find_word (line 13) | int find_word(char *words[WORD_COUNT], int word_count, const char *word)
  function compare_str (line 23) | int compare_str(const void *p1, const void *p2)
  function main (line 28) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch17_指针的高级应用/ex_05.c
  type point (line 15) | struct point { int x, y; }
  type rectangle (line 16) | struct rectangle { struct point upper_left, lower_right; }
  type rectangle (line 17) | struct rectangle
  function print_rectangle (line 19) | void print_rectangle(struct rectangle *p)
  function main (line 28) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch17_指针的高级应用/ex_06.c
  function main (line 31) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch17_指针的高级应用/ex_10.c
  type Bool (line 12) | typedef enum { TRUE, FALSE } Bool;
  type node (line 14) | struct node {
  function is_empty (line 19) | int is_empty(struct node *stack)
  function Bool (line 24) | Bool push(struct node **stack, int i)
  function pop (line 39) | int pop(struct node **stack)
  function make_empty (line 53) | void make_empty(struct node **stack)
  function main (line 62) | int main()

FILE: codes/CProgramming/ch17_指针的高级应用/ex_12.c
  function main (line 38) | int main()
  function f1 (line 44) | int f1(int (*f)(int))
  function f2 (line 51) | int f2(int i)

FILE: codes/CProgramming/ch17_指针的高级应用/ex_13.c
  function sum (line 9) | int sum(int (*f)(int), int start, int end)
  function func (line 18) | int func(int i)
  function main (line 23) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch17_指针的高级应用/ex_14.c
  function compare_int (line 12) | int compare_int(const void* p1, const void* p2)
  function main (line 17) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch17_指针的高级应用/ex_17.c
  function new_cmd (line 19) | void new_cmd(void)
  function open_cmd (line 24) | void open_cmd(void)
  function Invoke (line 37) | void Invoke(const char *func_name)
  function main (line 50) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch17_指针的高级应用/list/list.c
  type node (line 5) | struct node
  type node (line 5) | struct node
  type node (line 7) | struct node
  type node (line 9) | struct node
  type node (line 20) | struct node
  type node (line 20) | struct node
  type node (line 22) | struct node
  type node (line 31) | struct node
  type node (line 31) | struct node
  type node (line 33) | struct node
  type node (line 51) | struct node
  type node (line 51) | struct node
  type node (line 53) | struct node
  function delete_from_list_ex_11 (line 76) | void delete_from_list_ex_11(struct node **list, int n)
  function destroy_list (line 95) | void destroy_list(struct node *list)

FILE: codes/CProgramming/ch17_指针的高级应用/list/list.h
  type node (line 4) | struct node {
  type node (line 16) | struct node
  type node (line 16) | struct node
  type node (line 25) | struct node
  type node (line 25) | struct node
  type node (line 34) | struct node
  type node (line 34) | struct node
  type node (line 37) | struct node
  type node (line 37) | struct node
  type node (line 39) | struct node
  type node (line 44) | struct node

FILE: codes/CProgramming/ch17_指针的高级应用/list/main.c
  function print_list (line 5) | void print_list(struct node *list)
  type node (line 13) | struct node
  type node (line 15) | struct node
  function search (line 27) | void search(struct node *list)
  function delete (line 44) | void delete(struct node **list)
  function main (line 64) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch17_指针的高级应用/program_parts/invent.c
  type part (line 13) | struct part {
  type part_pointer_pair (line 20) | struct part_pointer_pair {
  type part (line 25) | struct part
  type part (line 29) | struct part
  type part_pointer_pair (line 30) | struct part_pointer_pair
  function main (line 45) | int main(int argc, char const *argv[])
  type part (line 74) | struct part
  type part (line 76) | struct part
  function find_part2 (line 86) | struct part_pointer_pair find_part2(int number)
  function insert (line 110) | void insert(void)
  function search (line 151) | void search(void)
  function update (line 175) | void update(void)
  function erase (line 197) | void erase(void)
  function print (line 230) | void print(void)

FILE: codes/CProgramming/ch17_指针的高级应用/program_parts/readline.c
  function read_line (line 5) | int read_line(char str[], int n)

FILE: codes/CProgramming/ch17_指针的高级应用/remind2.c
  function main (line 16) | int main()
  function read_line (line 64) | int read_line(char str[], int n)

FILE: codes/CProgramming/ch17_指针的高级应用/tabulate.c
  function main (line 19) | int main(int argc, char const *argv[])
  function tabulate (line 41) | void tabulate(double (*f)(double), double first, double last, double incre)

FILE: codes/CProgramming/ch18_声明/ex_04.c
  function f (line 19) | int f(int i)
  function main (line 25) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch18_声明/ex_06.c
  function test_a (line 18) | char test_a(int i) { return 0; }
  function test_d (line 25) | void test_d(int i) {}
  function main (line 41) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch18_声明/ex_07.c
  type FuncA (line 9) | typedef FuncA ArrA[10];
  type Arr5Int (line 15) | typedef Arr5Int* (*FuncB)(int);
  type FuncDRet (line 21) | typedef FuncDRet (*FuncD)(int, FuncDRet);
  function test_a (line 23) | char test_a(int i) { return 0; }
  function test_d (line 25) | void test_d(int i) {}
  function main (line 41) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch18_声明/ex_08.c
  type t (line 16) | typedef struct t_ { int v; } t;
  function insert (line 21) | void insert() {}
  function search (line 22) | void search() {}
  function update (line 23) | void update() {}
  function print (line 24) | void print() {}
  type t (line 29) | typedef t* (*d_func)(int, int);
  function main (line 32) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch18_声明/ex_09.c
  function test_g (line 18) | int test_g(int i) { return 0; }
  function main (line 26) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch18_声明/ex_10.c
  function main (line 20) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch18_声明/ex_11.c
  type B (line 15) | enum B { FOO, GOO }
  type S (line 17) | struct S { int v; }
  function main (line 21) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch18_声明/example_register.c
  function sum_array (line 18) | int sum_array(int a[], int n)
  function main (line 28) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch19_程序设计/ex_01.c
  function main (line 19) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch19_程序设计/ex_07.cpp
  class Fraction (line 9) | class Fraction {
    method Fraction (line 14) | Fraction() : numberator(0), denominator(0) {}
    method Fraction (line 15) | Fraction(int n, int d) : numberator(n), denominator(d) {}
    method print (line 23) | void print()
    method reduce (line 27) | void reduce()
  function Fraction (line 49) | Fraction operator+(const Fraction& lhs, const Fraction& rhs)
    method Fraction (line 14) | Fraction() : numberator(0), denominator(0) {}
    method Fraction (line 15) | Fraction(int n, int d) : numberator(n), denominator(d) {}
    method print (line 23) | void print()
    method reduce (line 27) | void reduce()
  function Fraction (line 57) | Fraction operator-(const Fraction& lhs, const Fraction& rhs)
    method Fraction (line 14) | Fraction() : numberator(0), denominator(0) {}
    method Fraction (line 15) | Fraction(int n, int d) : numberator(n), denominator(d) {}
    method print (line 23) | void print()
    method reduce (line 27) | void reduce()
  function Fraction (line 65) | Fraction operator/(const Fraction& lhs, const Fraction& rhs)
    method Fraction (line 14) | Fraction() : numberator(0), denominator(0) {}
    method Fraction (line 15) | Fraction(int n, int d) : numberator(n), denominator(d) {}
    method print (line 23) | void print()
    method reduce (line 27) | void reduce()
  function main (line 74) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch19_程序设计/queue/main.c
  function main (line 4) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch19_程序设计/queue/queue.h
  type ValueType (line 4) | typedef int ValueType;
  type Bool (line 5) | typedef enum { TRUE, FALSE } Bool;

FILE: codes/CProgramming/ch19_程序设计/queue/queue_impl1.c
  function init_queue (line 19) | void init_queue()
  function destroy_queue (line 28) | void destroy_queue()
  function queue_push (line 36) | void queue_push(ValueType v)
  function queue_pop (line 56) | void queue_pop()
  function ValueType (line 70) | ValueType queue_first()
  function ValueType (line 85) | ValueType queue_last()
  function Bool (line 100) | Bool queue_is_empty()

FILE: codes/CProgramming/ch19_程序设计/queue/queue_impl2.c
  type node (line 9) | struct node {
  type node (line 14) | struct node
  type node (line 15) | struct node
  function PUBLIC (line 20) | PUBLIC void init_queue()
  function PUBLIC (line 29) | PUBLIC void destroy_queue()
  function PUBLIC (line 47) | PUBLIC void queue_push(ValueType v)
  function PUBLIC (line 69) | PUBLIC void queue_pop()
  function PUBLIC (line 85) | PUBLIC ValueType queue_first()
  function PUBLIC (line 99) | PUBLIC ValueType queue_last()
  function PUBLIC (line 113) | PUBLIC Bool queue_is_empty()

FILE: codes/CProgramming/ch19_程序设计/queue2/main.c
  function main (line 4) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch19_程序设计/queue2/queue.c
  function Queue (line 16) | Queue* init_queue()
  function destroy_queue (line 34) | void destroy_queue(Queue *queue)
  function queue_push (line 43) | void queue_push(Queue *queue, ValueType v)
  function queue_pop (line 63) | void queue_pop(Queue *queue)
  function ValueType (line 77) | ValueType queue_first(Queue *queue)
  function ValueType (line 92) | ValueType queue_last(Queue *queue)
  function Bool (line 107) | Bool queue_is_empty(Queue *queue)
  function Queue (line 119) | Queue* init_queue()
  function destroy_queue (line 133) | void destroy_queue(Queue *queue)
  function queue_push (line 151) | void queue_push(Queue *queue, ValueType v)
  function queue_pop (line 173) | void queue_pop(Queue *queue)
  function ValueType (line 189) | ValueType queue_first(Queue *queue)
  function ValueType (line 203) | ValueType queue_last(Queue *queue)
  function Bool (line 217) | Bool queue_is_empty(Queue *queue)

FILE: codes/CProgramming/ch19_程序设计/queue2/queue.h
  type ValueType (line 7) | typedef int ValueType;
  type Bool (line 8) | typedef enum { TRUE, FALSE } Bool;
  type queue (line 12) | struct queue {
  type node (line 21) | struct node {
  type queue (line 26) | struct queue {
  type Queue (line 32) | typedef struct queue Queue;

FILE: codes/CProgramming/ch19_程序设计/queue3/main.cpp
  function main (line 4) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch19_程序设计/queue3/queue.cpp
  function ValueType (line 61) | ValueType Queue::first()
  function ValueType (line 76) | ValueType Queue::last()

FILE: codes/CProgramming/ch19_程序设计/queue3/queue.h
  type ValueType (line 6) | typedef int ValueType;
  function class (line 9) | class Queue {

FILE: codes/CProgramming/ch19_程序设计/queue4/main.cpp
  function main (line 6) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch19_程序设计/queue4/queue.h
  function push (line 34) | void push(ValueType v)
  function pop (line 60) | void pop()
  function ValueType (line 77) | ValueType first()
  function ValueType (line 92) | ValueType last()
  function is_empty (line 107) | bool is_empty()

FILE: codes/CProgramming/ch19_程序设计/stack/main.c
  function main (line 6) | int main()

FILE: codes/CProgramming/ch19_程序设计/stack/stack.c
  function Stack (line 7) | Stack* stack_init()
  function stack_destroy (line 19) | void stack_destroy(Stack *stack)
  function stack_make_empty (line 25) | void stack_make_empty(Stack *stack)
  function stack_is_empty (line 30) | int stack_is_empty(Stack *stack)
  function stack_push (line 35) | void stack_push(Stack *stack, ValueType i)
  function ValueType (line 49) | ValueType stack_pop(Stack *stack)
  function Stack (line 57) | Stack* stack_init()
  function stack_destroy (line 66) | void stack_destroy(Stack *stack)
  function stack_make_empty (line 77) | void stack_make_empty(Stack *stack)
  function stack_is_empty (line 87) | int stack_is_empty(Stack *stack)
  function stack_push (line 92) | void stack_push(Stack *stack, ValueType v)
  function ValueType (line 100) | ValueType stack_pop(Stack *stack)

FILE: codes/CProgramming/ch19_程序设计/stack/stack.h
  type ValueType (line 7) | typedef int ValueType;
  type stack (line 11) | struct stack {
  type node (line 20) | struct node {
  type stack (line 25) | struct stack {
  type Stack (line 30) | typedef struct stack Stack;

FILE: codes/CProgramming/ch20_低级程序设计/ex_01.c
  function main (line 26) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch20_低级程序设计/ex_02.c
  function PrintFlag (line 14) | void PrintFlag(int _flag)
  function main (line 26) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch20_低级程序设计/ex_03.c
  function main (line 15) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch20_低级程序设计/ex_04.c
  type color_field (line 10) | struct color_field {
  type color_field (line 18) | struct color_field
  function mk_color (line 22) | long int mk_color(int r, int g, int b)
  function get_color (line 32) | void get_color(long int v, unsigned char colors[3])
  function main (line 41) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch20_低级程序设计/ex_05.c
  type color_field (line 8) | struct color_field {
  type color_field (line 16) | struct color_field
  function mk_color (line 20) | long int mk_color(int r, int g, int b)
  function get_color (line 30) | void get_color(long int v, unsigned char colors[3])
  type color_type (line 39) | enum color_type { RED, GREEN, BLUE }
  function get_certain_color (line 40) | unsigned char get_certain_color(long int v, enum color_type ct)
  function main (line 51) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch20_低级程序设计/ex_06.c
  type trans_field (line 17) | struct trans_field {
  type trans_field (line 23) | struct trans_field
  function swap_byte (line 27) | unsigned short int swap_byte(unsigned short int i)
  function main (line 44) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch20_低级程序设计/ex_07.c
  type UInt16 (line 17) | typedef unsigned short UInt16;
  type CutDir (line 19) | typedef enum { LEFT, RIGHT } CutDir;
  function cut (line 20) | static unsigned short cut(UInt16 i, CutDir dir, int n)
  function UInt16 (line 51) | UInt16 rotate_left(UInt16 i, int n)
  function UInt16 (line 62) | UInt16 rotate_right(UInt16 i, int n)
  function main (line 74) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch20_低级程序设计/ex_08.c
  function f (line 20) | unsigned int f(unsigned int i, int m, int n)
  function main (line 25) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch20_低级程序设计/ex_09.c
  type type_field (line 8) | struct type_field {
  function main (line 14) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch20_低级程序设计/ex_10.c
  type type_field (line 9) | struct type_field {
  type type_field (line 16) | struct type_field
  function main (line 20) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch20_低级程序设计/test_bit_field.c
  type file_date (line 11) | struct file_date {
  function main (line 17) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch20_低级程序设计/xor.c
  function main (line 8) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch21_标准库/ex_03.c
  function Test (line 11) | void Test()
  function main (line 18) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch21_标准库/ex_05.c
  type s (line 14) | struct s {
  function main (line 20) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch22_输入_输出/canopen.c
  function main (line 5) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch22_输入_输出/dir_ex_19/invent.c
  type part (line 14) | struct part {
  function main (line 37) | int main(int argc, char const *argv[])
  function find_part (line 67) | int find_part(int number)
  function insert (line 84) | void insert(void)
  function search (line 117) | void search(void)
  function update (line 139) | void update(void)
  function print (line 164) | void print(void)
  function compare_parts (line 173) | int compare_parts(const void *p, const void *q)
  function dump (line 178) | void dump(void)
  function restore (line 202) | void restore(void)

FILE: codes/CProgramming/ch22_输入_输出/dir_ex_19/readline.c
  function read_line (line 5) | int read_line(char str[], int n)

FILE: codes/CProgramming/ch22_输入_输出/dir_ex_21/invent.c
  type part (line 13) | struct part {
  type part_pointer_pair (line 20) | struct part_pointer_pair {
  type part (line 25) | struct part
  type part (line 29) | struct part
  type part_pointer_pair (line 30) | struct part_pointer_pair
  function main (line 47) | int main(int argc, char const *argv[])
  type part (line 78) | struct part
  type part (line 80) | struct part
  function find_part2 (line 90) | struct part_pointer_pair find_part2(int number)
  function insert (line 114) | void insert(void)
  function search (line 155) | void search(void)
  function update (line 179) | void update(void)
  function erase (line 201) | void erase(void)
  function print (line 234) | void print(void)
  function dump (line 243) | void dump(void)
  function restore (line 270) | void restore(void)

FILE: codes/CProgramming/ch22_输入_输出/dir_ex_21/readline.c
  function read_line (line 5) | int read_line(char str[], int n)

FILE: codes/CProgramming/ch22_输入_输出/ex_03.c
  function main (line 13) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch22_输入_输出/ex_04.c
  function main (line 19) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch22_输入_输出/ex_05.c
  function main (line 11) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch22_输入_输出/ex_06.c
  function main (line 8) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch22_输入_输出/ex_07.c
  function main (line 22) | int main()

FILE: codes/CProgramming/ch22_输入_输出/ex_08.c
  function main (line 11) | int main()

FILE: codes/CProgramming/ch22_输入_输出/ex_09.c
  function main (line 16) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch22_输入_输出/ex_12.c
  function main (line 17) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch22_输入_输出/ex_13.c
  function main (line 18) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch22_输入_输出/ex_14.c
  function cntchar (line 16) | void cntchar(const char *file_name)
  function read_word (line 37) | static int read_word(FILE *fp)
  function cntword (line 53) | void cntword(const char *file_name)
  function read_line (line 75) | static int read_line(FILE *fp)
  function cntline (line 88) | void cntline(const char *file_name)
  function main (line 109) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch22_输入_输出/ex_15.c
  function main (line 12) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch22_输入_输出/ex_16.c
  function main (line 12) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch22_输入_输出/ex_17.c
  function comp (line 29) | void comp(const char *in, const char *out)
  function uncomp (line 88) | void uncomp(const char *in)
  function main (line 132) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch22_输入_输出/ex_18.c
  function my_fputs (line 36) | int my_fputs(const char *str, FILE *stream)
  function main (line 44) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch22_输入_输出/ex_20.c
  type Part (line 13) | typedef struct part {
  function main (line 19) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch22_输入_输出/ex_22.c
  function main (line 14) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch22_输入_输出/ex_23.c
  function main (line 12) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch22_输入_输出/fcopy.c
  function main (line 6) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch22_输入_输出/invclear.c
  type part (line 9) | struct part {
  function main (line 17) | int main()

FILE: codes/CProgramming/ch22_输入_输出/test_enter.c
  function main (line 9) | int main(int argc, char* argv[])

FILE: codes/CProgramming/ch23_库对数值和字符数据的支持/ex_01.c
  function main (line 9) | int main()

FILE: codes/CProgramming/ch23_库对数值和字符数据的支持/ex_02.c
  function my_round (line 9) | double my_round(double x, int n)
  function main (line 17) | int main()

FILE: codes/CProgramming/ch23_库对数值和字符数据的支持/ex_03.c
  function is_correct_identifier (line 9) | int is_correct_identifier(const char *identifier)
  function main (line 24) | int main()

FILE: codes/CProgramming/ch23_库对数值和字符数据的支持/ex_04.c
  function is_blank_line (line 9) | int is_blank_line(const char *line)
  function main (line 23) | int main()

FILE: codes/CProgramming/ch23_库对数值和字符数据的支持/ex_05.c
  function main (line 8) | int main()

FILE: codes/CProgramming/ch23_库对数值和字符数据的支持/ex_06.c
  function a (line 21) | void a()
  function b (line 31) | void b()
  function c (line 40) | void c()
  function d (line 54) | void d()
  function main (line 64) | int main()

FILE: codes/CProgramming/ch23_库对数值和字符数据的支持/ex_07.c
  function main (line 13) | int main()

FILE: codes/CProgramming/ch23_库对数值和字符数据的支持/ex_08.c
  function numchar (line 10) | int numchar(const char *s, char ch)
  function main (line 24) | int main()

FILE: codes/CProgramming/ch23_库对数值和字符数据的支持/ex_10.c
  function old (line 18) | void old()
  function new (line 33) | void new()
  function main (line 48) | int main()

FILE: codes/CProgramming/ch23_库对数值和字符数据的支持/ex_11.c
  function main (line 9) | int main()

FILE: codes/CProgramming/ch23_库对数值和字符数据的支持/ex_12.c
  function main (line 8) | int main()

FILE: codes/CProgramming/ch23_库对数值和字符数据的支持/ex_13.c
  function test_strdup (line 27) | void test_strdup()
  function stricmp (line 37) | int stricmp(const char *s1, const char *s2)
  function test_stricmp (line 56) | void test_stricmp()
  function test_strlwr (line 88) | void test_strlwr()
  function test_strrev (line 116) | void test_strrev()
  function test_strset (line 136) | void test_strset()
  function main (line 146) | int main()

FILE: codes/CProgramming/ch23_库对数值和字符数据的支持/tcasemap.c
  function main (line 8) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch24_错误处理/dir_ex_04/invent.c
  type part (line 16) | struct part {
  function main (line 37) | int main(int argc, char const *argv[])
  function find_part (line 68) | int find_part(int number)
  function insert (line 85) | void insert(void)
  function search (line 120) | void search(void)
  function update (line 144) | void update(void)
  function print (line 171) | void print(void)
  function compare_parts (line 182) | int compare_parts(const void *p, const void *q)

FILE: codes/CProgramming/ch24_错误处理/dir_ex_04/readline.c
  function read_line (line 5) | int read_line(char str[], int n)

FILE: codes/CProgramming/ch24_错误处理/ex_02.c
  function try_math_fnc (line 29) | double try_math_fnc(pFnc func, double param, const char* error_desc)
  function main (line 40) | int main()

FILE: codes/CProgramming/ch24_错误处理/ex_03.c
  function handle_sigint (line 10) | void handle_sigint(int sig)
  function main (line 22) | int main()

FILE: codes/CProgramming/ch24_错误处理/tsetjmp.c
  function main (line 21) | int main()
  function f1 (line 39) | void f1()
  function f2 (line 46) | void f2()

FILE: codes/CProgramming/ch24_错误处理/tsignal.c
  function main (line 9) | int main()
  function handler (line 31) | void handler(int sig)
  function raise_sig (line 36) | void raise_sig(void)

FILE: codes/CProgramming/ch25_国际化特性/ex_01.c
  function test1 (line 13) | void test1()
  function main (line 20) | int main()

FILE: codes/CProgramming/ch25_国际化特性/ex_02.c
  function test2 (line 13) | void test2()
  function main (line 20) | int main()

FILE: codes/CProgramming/ch25_国际化特性/ex_03.c
  function mbcheck (line 23) | int mbcheck(const char *s)
  function main (line 32) | int main()

FILE: codes/CProgramming/ch26_其他库函数/airmiles.c
  type city_info (line 7) | struct city_info {
  function main (line 14) | int main()
  function compare_city (line 34) | int compare_city(const void *key_ptr, const void *element_ptr)

FILE: codes/CProgramming/ch26_其他库函数/datetime.c
  function main (line 6) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch26_其他库函数/errorf.c
  function errorf (line 8) | int errorf(const char *format, ...)
  function main (line 24) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch26_其他库函数/ex_01.c
  function max_int (line 10) | int max_int(int n, ...)
  function main (line 27) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch26_其他库函数/ex_02.c
  function my_printf (line 9) | int my_printf(const char* format, ...)
  function main (line 42) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch26_其他库函数/ex_03.c
  function main (line 63) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch26_其他库函数/ex_04.c
  function main (line 14) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch26_其他库函数/ex_05.c
  function main (line 10) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch26_其他库函数/ex_06.c
  function random_double (line 8) | double random_double()
  function main (line 13) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch26_其他库函数/ex_07.c
  function main (line 12) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch26_其他库函数/ex_08.c
  function main (line 19) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch26_其他库函数/ex_09.c
  function f1 (line 10) | void f1()
  function f2 (line 15) | void f2()
  function main (line 20) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch26_其他库函数/ex_10.c
  function compare (line 12) | int compare(const void* p1, const void* p2)
  function main (line 17) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch26_其他库函数/ex_11.c
  function time_t (line 9) | time_t f()
  function main (line 27) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch26_其他库函数/ex_12.c
  function time_t (line 9) | time_t f()
  function main (line 34) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch26_其他库函数/ex_13.c
  function f (line 10) | void f()
  function main (line 39) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch26_其他库函数/ex_14.c
  function a (line 13) | void a()
  function b (line 28) | void b()
  function c (line 38) | void c()
  function main (line 48) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch26_其他库函数/max_int.c
  function max_int (line 4) | int max_int(int n, ...)
  function main (line 22) | int main()

FILE: codes/CProgramming/ch26_其他库函数/trand.c
  function main (line 6) | int main(int argc, char const *argv[])

FILE: codes/CProgramming/ch26_其他库函数/tstrconv.c
  function main (line 11) | int main(int argc, char const *argv[])

FILE: codes/CppPrimer/ch01_Getting_Started/Sales_item.h
  function class (line 45) | class Sales_item {
  function compareIsbn (line 75) | inline

FILE: codes/CppPrimer/ch01_Getting_Started/example_comments.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/example_for.cpp
  function main (line 5) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/example_if.cpp
  function main (line 6) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/example_iostream.cpp
  function main (line 5) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/example_main.cpp
  function main (line 3) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/example_while.cpp
  function main (line 5) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/exercise_1_01.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/exercise_1_02.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/exercise_1_03.cpp
  function main (line 7) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/exercise_1_04.cpp
  function main (line 8) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/exercise_1_05.cpp
  function main (line 7) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/exercise_1_06.cpp
  function main (line 21) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/exercise_1_08.cpp
  function main (line 18) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/exercise_1_09.cpp
  function main (line 7) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/exercise_1_10.cpp
  function main (line 7) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/exercise_1_11.cpp
  function main (line 7) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/exercise_1_12.cpp
  function main (line 15) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/exercise_1_13.cpp
  function main (line 33) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/exercise_1_14.cpp
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/exercise_1_15.cpp
  function main (line 7) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/exercise_1_16.cpp
  function main (line 7) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/exercise_1_17.cpp
  function main (line 23) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/exercise_1_18.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/exercise_1_19.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/exercise_1_20.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/exercise_1_21.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/exercise_1_22.cpp
  function main (line 14) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/exercise_1_23.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/exercise_1_24.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/exercise_1_25.cpp
  function main (line 10) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/test_clog.cpp
  function main (line 8) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/usage_Sales_item_avg_price.cpp
  function main (line 8) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/usage_add_Sales_item.cpp
  function main (line 6) | int main()

FILE: codes/CppPrimer/ch01_Getting_Started/usage_read_inputs.cpp
  function main (line 4) | int main()

FILE: codes/CppPrimer/ch02_Variables_and_Basic_Types/Sales_data.h
  type Sales_data (line 6) | struct Sales_data

FILE: codes/CppPrimer/ch02_Variables_and_Basic_Types/exercise_2_04.cpp
  function main (line 7) | int main()

FILE: codes/CppPrimer/ch02_Variables_and_Basic_Types/exercise_2_06.cpp
  function main (line 16) | int main()

FILE: codes/CppPrimer/ch02_Variables_and_Basic_Types/exercise_2_07.cpp
  function main (line 19) | int main()

FILE: codes/CppPrimer/ch02_Variables_and_Basic_Types/exercise_2_08.cpp
  function main (line 7) | int main()

FILE: codes/CppPrimer/ch02_Variables_and_Basic_Types/exercise_2_09.cpp
  function main (line 23) | int main()

FILE: codes/CppPrimer/ch02_Variables_and_Basic_Types/exercise_2_10.cpp
  function main (line 22) | int main()

FILE: codes/CppPrimer/ch02_Variables_and_Basic_Types/exercise_2_13.cpp
  function main (line 19) | int main()

FILE: codes/CppPrimer/ch02_Variables_and_Basic_Types/exercise_2_14.cpp
  function main (line 16) | int main()

FILE: codes/CppPrimer/ch02_Variables_and_Basic_Types/exercise_2_16.cpp
  function main (line 16) | int main()

FILE: codes/CppPrimer/ch02_Variables_and_Basic_Types/exercise_2_17.cpp
  function main (line 15) | int main()

FILE: codes/CppPrimer/ch02_Variables_and_Basic_Types/exercise_2_18.cpp
  function main (line 7) | int main()

FILE: codes/CppPrimer/ch02_Variables_and_Basic_Types/exercise_2_20.cpp
  function main (line 15) | int main()

FILE: codes/CppPrimer/ch02_Variables_and_Basic_Types/exercise_2_27.cpp
  function main (line 23) | int main()

FILE: codes/CppPrimer/ch02_Variables_and_Basic_Types/exercise_2_34.cpp
  function main (line 7) | int main()

FILE: codes/CppPrimer/ch02_Variables_and_Basic_Types/exercise_2_35.cpp
  function main (line 19) | int main()

FILE: codes/CppPrimer/ch02_Variables_and_Basic_Types/exercise_2_36.cpp
  function main (line 20) | int main()

FILE: codes/CppPrimer/ch02_Variables_and_Basic_Types/exercise_2_39.cpp
  function main (line 10) | struct Foo {} // 注意:没有分号

FILE: codes/CppPrimer/ch02_Variables_and_Basic_Types/exercise_2_40.cpp
  type Sales_data (line 7) | struct Sales_data
  function main (line 14) | int main()

FILE: codes/CppPrimer/ch02_Variables_and_Basic_Types/exercise_2_41.cpp
  type Sales_data (line 8) | struct Sales_data
  function main (line 157) | int main()

FILE: codes/CppPrimer/ch02_Variables_and_Basic_Types/exercise_2_42.cpp
  function main (line 151) | int main()

FILE: codes/CppPrimer/ch02_Variables_and_Basic_Types/test_char.cpp
  function main (line 3) | int main()

FILE: codes/CppPrimer/ch02_Variables_and_Basic_Types/test_list_initialization.cpp
  function main (line 5) | int main()

FILE: codes/CppPrimer/ch02_Variables_and_Basic_Types/test_literal.cpp
  function main (line 3) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/example_getline.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/example_normal_array_simulate_dimensional_array.cpp
  function get_idx (line 14) | int get_idx(int r, int c)
  function init_func (line 20) | void init_func()
  function print_row (line 31) | void print_row(int r)
  function clear_arr (line 45) | void clear_arr()
  function main (line 51) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/example_push_back.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/example_range_for.cpp
  function main (line 10) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/example_read_string.cpp
  function main (line 15) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/example_using_iterators.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/example_using_subscript.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_01.cpp
  function main (line 44) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_02.cpp
  function main (line 24) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_04a.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_04b.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_05a.cpp
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_05b.cpp
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_06.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_07.cpp
  function main (line 16) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_08a.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_08b.cpp
  function main (line 16) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_10.cpp
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_13.cpp
  function main (line 29) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_14.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_15.cpp
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_16.cpp
  function main (line 22) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_17.cpp
  function main (line 15) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_19.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_20a.cpp
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_20b.cpp
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_21.cpp
  function main (line 22) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_22.cpp
  function main (line 14) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_23.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_24a.cpp
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_24b.cpp
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_25.cpp
  function main (line 17) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_28.cpp
  function main (line 24) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_31.cpp
  function main (line 10) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_32a.cpp
  function main (line 10) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_32b.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_35.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_36a.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_36b.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_37.cpp
  function main (line 10) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_39a.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_39b.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_40.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_41.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_42.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_43a.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_43b.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_43c.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_44.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/exercise_3_45.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/usage_bsearch.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/usage_count_punct_in_string.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch03_Strings_Vectors_and_Arrays/usage_string_toupper.cpp
  function main (line 10) | int main()

FILE: codes/CppPrimer/ch04_Expressions/example_comma_operator.cpp
  function main (line 15) | int main()

FILE: codes/CppPrimer/ch04_Expressions/example_increment_operator.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch04_Expressions/exercise_4_04.cpp
  function main (line 15) | int main()

FILE: codes/CppPrimer/ch04_Expressions/exercise_4_07.cpp
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch04_Expressions/exercise_4_10.cpp
  function main (line 10) | int main()

FILE: codes/CppPrimer/ch04_Expressions/exercise_4_13.cpp
  function main (line 14) | int main()

FILE: codes/CppPrimer/ch04_Expressions/exercise_4_16.cpp
  function main (line 17) | int main()

FILE: codes/CppPrimer/ch04_Expressions/exercise_4_21.cpp
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch04_Expressions/exercise_4_22a.cpp
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch04_Expressions/exercise_4_22b.cpp
  function main (line 17) | int main()

FILE: codes/CppPrimer/ch04_Expressions/exercise_4_23.cpp
  function main (line 22) | int main()

FILE: codes/CppPrimer/ch04_Expressions/exercise_4_25.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch04_Expressions/exercise_4_27.cpp
  function main (line 15) | int main()

FILE: codes/CppPrimer/ch04_Expressions/exercise_4_28.cpp
  function main (line 17) | int main()

FILE: codes/CppPrimer/ch04_Expressions/exercise_4_29.cpp
  function main (line 14) | int main()

FILE: codes/CppPrimer/ch04_Expressions/exercise_4_31.cpp
  function main (line 17) | int main()

FILE: codes/CppPrimer/ch04_Expressions/test_bitwise_oparator.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch04_Expressions/test_sizeof.cpp
  function f (line 13) | void f()
  function f2 (line 17) | int f2()
  function main (line 22) | int main()

FILE: codes/CppPrimer/ch05_Statements/example_do_while.cpp
  function main (line 15) | int main()

FILE: codes/CppPrimer/ch05_Statements/example_if_statement.cpp
  function main (line 18) | int main()

FILE: codes/CppPrimer/ch05_Statements/exercise_5_03.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch05_Statements/exercise_5_05.cpp
  function main (line 19) | int main()

FILE: codes/CppPrimer/ch05_Statements/exercise_5_06.cpp
  function main (line 15) | int main()

FILE: codes/CppPrimer/ch05_Statements/exercise_5_09.cpp
  function main (line 15) | int main()

FILE: codes/CppPrimer/ch05_Statements/exercise_5_10.cpp
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch05_Statements/exercise_5_11.cpp
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch05_Statements/exercise_5_12.cpp
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch05_Statements/exercise_5_14.cpp
  function main (line 17) | int main()

FILE: codes/CppPrimer/ch05_Statements/exercise_5_16a.cpp
  function main (line 15) | int main()

FILE: codes/CppPrimer/ch05_Statements/exercise_5_16b.cpp
  function main (line 15) | int main()

FILE: codes/CppPrimer/ch05_Statements/exercise_5_16c.cpp
  function main (line 15) | int main()

FILE: codes/CppPrimer/ch05_Statements/exercise_5_16d.cpp
  function main (line 17) | int main()

FILE: codes/CppPrimer/ch05_Statements/exercise_5_17.cpp
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch05_Statements/exercise_5_19.cpp
  function main (line 14) | int main()

FILE: codes/CppPrimer/ch05_Statements/exercise_5_20.cpp
  function main (line 16) | int main()

FILE: codes/CppPrimer/ch05_Statements/exercise_5_21.cpp
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch05_Statements/exercise_5_23.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch05_Statements/exercise_5_24.cpp
  function main (line 18) | int main()

FILE: codes/CppPrimer/ch05_Statements/exercise_5_25.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch06_Functions/example_array_param.cpp
  function print (line 14) | void print(const char *cp)
  function print (line 22) | void print(const int *beg, const int *end)
  function print (line 33) | void print(const int ia[], size_t size)
  function print (line 42) | void print(int (&arr)[10])
  function main (line 49) | int main()

FILE: codes/CppPrimer/ch06_Functions/example_const_cast_and_overloading.cpp
  function string (line 12) | const string &shorterString(const string &s1, const string &s2)
  function string (line 20) | string &shorterString(string &s1, string &s2)
  function main (line 28) | int main()

FILE: codes/CppPrimer/ch06_Functions/example_functions_with_no_return_value.cpp
  function swap (line 8) | void swap(int &v1, int &v2)
  function main (line 21) | int main()

FILE: codes/CppPrimer/ch06_Functions/example_initializer_list_param.cpp
  function error_msg (line 13) | void error_msg(int error_num, initializer_list<string> il)
  function main (line 21) | int main()

FILE: codes/CppPrimer/ch06_Functions/example_inline_functions.cpp
  function string (line 12) | inline const string &
  function main (line 18) | int main()

FILE: codes/CppPrimer/ch06_Functions/example_passing_a_multidimensional_array.cpp
  function print (line 9) | void print(int (*matrix)[10], int rowSize)
  function main (line 19) | int main()

FILE: codes/CppPrimer/ch06_Functions/example_preprocessor_variable.cpp
  function error_msg (line 8) | void error_msg(const char *msg)
  function main (line 18) | int main()

FILE: codes/CppPrimer/ch06_Functions/example_recursion.cpp
  function factorial (line 10) | int factorial(int val)
  function main (line 17) | int main()

FILE: codes/CppPrimer/ch06_Functions/example_return_from_main.cpp
  function main (line 5) | int main()

FILE: codes/CppPrimer/ch06_Functions/example_returning_a_pointer_to_an_array.cpp
  function main (line 21) | int main()

FILE: codes/CppPrimer/ch06_Functions/example_using_ref_to_avoid_cp.cpp
  function isShorter (line 12) | bool isShorter(const string &s1, const string &s2)
  function main (line 17) | int main()

FILE: codes/CppPrimer/ch06_Functions/example_using_ref_to_return_info.cpp
  function find_char (line 13) | string::size_type find_char(const string &s, char c, string::size_type &...
  function main (line 27) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_03.cpp
  function fact (line 11) | int fact(int n)
  function main (line 20) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_04.cpp
  function calc_fact_for_user (line 12) | int calc_fact_for_user()
  function main (line 30) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_05.cpp
  function my_abs (line 11) | int my_abs(int n)
  function main (line 19) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_06.cpp
  function foo (line 17) | int foo(int param)
  function main (line 25) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_07.cpp
  function foo (line 11) | int foo()
  function main (line 17) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_09/fact.cc
  function fact (line 3) | int fact(int n)

FILE: codes/CppPrimer/ch06_Functions/exercise_6_09/factMain.cc
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_10.cpp
  function swap (line 12) | void swap(int *a, int *b)
  function main (line 19) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_11.cpp
  function reset (line 11) | void reset(int &a)
  function main (line 16) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_12.cpp
  function swap (line 16) | void swap(int &a, int &b)
  function main (line 23) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_17.cpp
  function has_upper_char (line 18) | bool has_upper_char(const string &s)
  function str_tolower (line 27) | void str_tolower(string &s)
  function main (line 33) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_21.cpp
  function compare (line 14) | int compare(int a, const int *b)
  function main (line 19) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_22.cpp
  function swap (line 11) | void swap(int* &a, int* &b)
  function main (line 18) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_23.cpp
  function print (line 15) | void print(const char *cp)
  function print (line 23) | void print(const int *beg, const int *end)
  function print (line 34) | void print(const int ia[], size_t size)
  function main (line 42) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_24.cpp
  function print (line 20) | void print(const int (&ia)[10])
  function main (line 26) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_25.cpp
  function main (line 13) | int main(int argc, char* argv[])

FILE: codes/CppPrimer/ch06_Functions/exercise_6_26.cpp
  function main (line 11) | int main(int argc, char* argv[])

FILE: codes/CppPrimer/ch06_Functions/exercise_6_27.cpp
  function sum (line 14) | int sum(initializer_list<int> il)
  function main (line 24) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_30.cpp
  function str_subrange (line 17) | bool str_subrange(const string &str1, const string &str2)
  function main (line 35) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_33.cpp
  function print_vec (line 15) | void print_vec(Iter beg, Iter end)
  function main (line 24) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_34.cpp
  function factorial (line 18) | int factorial(int val)
  function main (line 25) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_36.cpp
  function main (line 17) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_37.cpp
  function main (line 30) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_38.cpp
  function main (line 23) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_42.cpp
  function string (line 15) | string make_plural(size_t ctr, const string &word, const string &ending ...
  function main (line 20) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_44.cpp
  function isShorter (line 14) | inline
  function main (line 20) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_46.cpp
  function isShorter (line 18) | constexpr
  function main (line 24) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_47.cpp
  function print_vec (line 18) | void print_vec(Iter beg, Iter end)
  function main (line 31) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_51.cpp
  function f (line 13) | void f()
  function f (line 18) | void f(int)
  function f (line 23) | void f(int, int)
  function f (line 28) | void f(double, double = 3.14)
  function main (line 33) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_54.cpp
  function main (line 16) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_55.cpp
  function Addition (line 16) | int Addition(int a, int b)
  function Subtraction (line 21) | int Subtraction(int a, int b)
  function Multiplication (line 26) | int Multiplication(int a, int b)
  function Division (line 31) | int Division(int a, int b)
  function main (line 36) | int main()

FILE: codes/CppPrimer/ch06_Functions/exercise_6_56.cpp
  function Addition (line 15) | int Addition(int a, int b)
  function Subtraction (line 20) | int Subtraction(int a, int b)
  function Multiplication (line 25) | int Multiplication(int a, int b)
  function Division (line 30) | int Division(int a, int b)
  function main (line 35) | int main()

FILE: codes/CppPrimer/ch07_Classes/example_Account/Account.h
  function class (line 7) | class Account

FILE: codes/CppPrimer/ch07_Classes/example_Account/main.cpp
  function main (line 8) | int main()

FILE: codes/CppPrimer/ch07_Classes/example_Person.cpp
  type Person (line 11) | struct Person
    method Person (line 18) | Person() = default;
    method Person (line 19) | Person(const std::string &_name, const std::string &_addr) :
    method GetName (line 23) | std::string GetName() const { return name; }
    method GetAddr (line 24) | std::string GetAddr() const { return addr; }
  function main (line 53) | int main()

FILE: codes/CppPrimer/ch07_Classes/example_Sales_data/Sales_data.h
  function class (line 12) | class Sales_data {
  function namespace (line 74) | namespace std {
  function std (line 118) | inline
  function Sales_data (line 127) | inline
  function std (line 133) | inline
  function Sales_data (line 141) | inline
  function Sales_data (line 184) | inline

FILE: codes/CppPrimer/ch07_Classes/example_Sales_data/exceptions.h
  function class (line 8) | class out_of_stock : public std::runtime_error {
  function class (line 13) | class isbn_mismatch : public std::logic_error {

FILE: codes/CppPrimer/ch07_Classes/example_Sales_data/main.cpp
  function test1 (line 11) | void test1()
  function test2 (line 35) | void test2()
  function test3 (line 60) | void test3()
  function test4 (line 68) | void test4()
  function test5 (line 82) | void test5()
  function main (line 89) | int main()

FILE: codes/CppPrimer/ch07_Classes/example_Screen/Screen.h
  function class (line 6) | class Screen
  function Screen (line 27) | const Screen &display(std::ostream &os) const { do_display(os); return *...
  function Screen (line 46) | inline
  function get (line 56) | char Screen::get(pos r, pos c) const
  function Screen (line 62) | inline
  function Screen (line 69) | inline

FILE: codes/CppPrimer/ch07_Classes/example_Screen/Window_mgr.h
  function clear (line 24) | inline

FILE: codes/CppPrimer/ch07_Classes/example_Screen/main.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch07_Classes/example_literal_classes/Debug.h
  function class (line 4) | class Debug
  function set_io (line 10) | void set_io(bool b) { io = b; }
  function set_hw (line 11) | void set_hw(bool b) { hw = b; }
  function set_other (line 12) | void set_other(bool b) { other = b; }

FILE: codes/CppPrimer/ch07_Classes/example_literal_classes/main.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_01.cpp
  type Sales_data (line 18) | struct Sales_data
  function main (line 47) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_02.cpp
  type Sales_data (line 13) | struct Sales_data
    method isbn (line 16) | std::string isbn() const { return bookNo; }
  function Sales_data (line 23) | Sales_data &Sales_data::combine(const Sales_data &rhs)
    method isbn (line 16) | std::string isbn() const { return bookNo; }
  function main (line 30) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_03.cpp
  type Sales_data (line 17) | struct Sales_data
    method isbn (line 20) | std::string isbn() const { return bookNo; }
  function Sales_data (line 27) | Sales_data &Sales_data::combine(const Sales_data &rhs)
    method isbn (line 20) | std::string isbn() const { return bookNo; }
  function main (line 56) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_04.cpp
  type Person (line 13) | struct Person
  function main (line 19) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_05.cpp
  type Person (line 16) | struct Person
    method GetName (line 18) | std::string GetName() const { return name; }
    method GetAddr (line 19) | std::string GetAddr() const { return addr; }
  function main (line 25) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_06.cpp
  type Sales_data (line 16) | struct Sales_data
    method isbn (line 19) | std::string isbn() const { return bookNo; }
  function Sales_data (line 26) | Sales_data &Sales_data::combine(const Sales_data &rhs)
    method isbn (line 19) | std::string isbn() const { return bookNo; }
  function Sales_data (line 55) | Sales_data add(const Sales_data &lhs, const Sales_data &rhs)
    method isbn (line 19) | std::string isbn() const { return bookNo; }
  function main (line 61) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_07.cpp
  type Sales_data (line 18) | struct Sales_data
    method isbn (line 21) | std::string isbn() const { return bookNo; }
  function Sales_data (line 28) | Sales_data &Sales_data::combine(const Sales_data &rhs)
    method isbn (line 21) | std::string isbn() const { return bookNo; }
  function Sales_data (line 57) | Sales_data add(const Sales_data &lhs, const Sales_data &rhs)
    method isbn (line 21) | std::string isbn() const { return bookNo; }
  function main (line 63) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_09.cpp
  type Person (line 12) | struct Person
    method GetName (line 14) | std::string GetName() const { return name; }
    method GetAddr (line 15) | std::string GetAddr() const { return addr; }
  function main (line 38) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_11.cpp
  type Sales_data (line 15) | struct Sales_data {
    method Sales_data (line 17) | Sales_data() = default;
    method Sales_data (line 18) | Sales_data(const std::string &s) : bookNo(s) { }
    method Sales_data (line 19) | Sales_data(const std::string &s, unsigned n, double p) :
    method isbn (line 24) | std::string isbn() const { return bookNo; }
  function Sales_data (line 47) | Sales_data& Sales_data::combine(const Sales_data &rhs)
    method Sales_data (line 17) | Sales_data() = default;
    method Sales_data (line 18) | Sales_data(const std::string &s) : bookNo(s) { }
    method Sales_data (line 19) | Sales_data(const std::string &s, unsigned n, double p) :
    method isbn (line 24) | std::string isbn() const { return bookNo; }
  function Sales_data (line 75) | Sales_data add(const Sales_data &lhs, const Sales_data &rhs)
    method Sales_data (line 17) | Sales_data() = default;
    method Sales_data (line 18) | Sales_data(const std::string &s) : bookNo(s) { }
    method Sales_data (line 19) | Sales_data(const std::string &s, unsigned n, double p) :
    method isbn (line 24) | std::string isbn() const { return bookNo; }
  function main (line 84) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_12.cpp
  type Sales_data (line 14) | struct Sales_data
    method Sales_data (line 19) | Sales_data() = default;
    method Sales_data (line 20) | Sales_data(const std::string &s) : bookNo(s) { }
    method Sales_data (line 21) | Sales_data(const std::string &s, unsigned n, double p) :
    method Sales_data (line 23) | Sales_data(std::istream &is)
    method isbn (line 29) | std::string isbn() const { return bookNo; }
  type Sales_data (line 17) | struct Sales_data {
    method Sales_data (line 19) | Sales_data() = default;
    method Sales_data (line 20) | Sales_data(const std::string &s) : bookNo(s) { }
    method Sales_data (line 21) | Sales_data(const std::string &s, unsigned n, double p) :
    method Sales_data (line 23) | Sales_data(std::istream &is)
    method isbn (line 29) | std::string isbn() const { return bookNo; }
  function Sales_data (line 51) | Sales_data& Sales_data::combine(const Sales_data &rhs)
    method Sales_data (line 19) | Sales_data() = default;
    method Sales_data (line 20) | Sales_data(const std::string &s) : bookNo(s) { }
    method Sales_data (line 21) | Sales_data(const std::string &s, unsigned n, double p) :
    method Sales_data (line 23) | Sales_data(std::istream &is)
    method isbn (line 29) | std::string isbn() const { return bookNo; }
  function Sales_data (line 74) | Sales_data add(const Sales_data &lhs, const Sales_data &rhs)
    method Sales_data (line 19) | Sales_data() = default;
    method Sales_data (line 20) | Sales_data(const std::string &s) : bookNo(s) { }
    method Sales_data (line 21) | Sales_data(const std::string &s, unsigned n, double p) :
    method Sales_data (line 23) | Sales_data(std::istream &is)
    method isbn (line 29) | std::string isbn() const { return bookNo; }
  function main (line 83) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_13.cpp
  type Sales_data (line 15) | struct Sales_data {
    method Sales_data (line 17) | Sales_data() = default;
    method Sales_data (line 18) | Sales_data(const std::string &s) : bookNo(s) { }
    method Sales_data (line 19) | Sales_data(const std::string &s, unsigned n, double p) :
    method isbn (line 24) | std::string isbn() const { return bookNo; }
  function Sales_data (line 47) | Sales_data& Sales_data::combine(const Sales_data &rhs)
    method Sales_data (line 17) | Sales_data() = default;
    method Sales_data (line 18) | Sales_data(const std::string &s) : bookNo(s) { }
    method Sales_data (line 19) | Sales_data(const std::string &s, unsigned n, double p) :
    method isbn (line 24) | std::string isbn() const { return bookNo; }
  function Sales_data (line 75) | Sales_data add(const Sales_data &lhs, const Sales_data &rhs)
    method Sales_data (line 17) | Sales_data() = default;
    method Sales_data (line 18) | Sales_data(const std::string &s) : bookNo(s) { }
    method Sales_data (line 19) | Sales_data(const std::string &s, unsigned n, double p) :
    method isbn (line 24) | std::string isbn() const { return bookNo; }
  function main (line 84) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_15.cpp
  type Person (line 12) | struct Person
    method Person (line 15) | Person() = default;
    method Person (line 16) | Person(const std::string &_name, const std::string &_addr) :
    method GetName (line 20) | std::string GetName() const { return name; }
    method GetAddr (line 21) | std::string GetAddr() const { return addr; }
  function main (line 49) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_19.cpp
  type Person (line 17) | struct Person
    method Person (line 21) | Person() = default;
    method Person (line 22) | Person(const std::string &_name, const std::string &_addr) :
    method GetName (line 26) | std::string GetName() const { return name; }
    method GetAddr (line 27) | std::string GetAddr() const { return addr; }
  function main (line 56) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_22.cpp
  type Person (line 12) | struct Person
    method Person (line 20) | Person() = default;
    method Person (line 21) | Person(const std::string &_name, const std::string &_addr) :
    method GetName (line 25) | std::string GetName() const { return name; }
    method GetAddr (line 26) | std::string GetAddr() const { return addr; }
  function main (line 55) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_23.cpp
  class Screen (line 11) | class Screen
    method Screen (line 16) | Screen() = default;
    method Screen (line 18) | Screen(pos ht, pos wd, char c) : height(ht), width(wd), contents(ht * ...
    method get (line 20) | char get() const { return contents[cursor]; }
  function Screen (line 32) | inline
    method Screen (line 16) | Screen() = default;
    method Screen (line 18) | Screen(pos ht, pos wd, char c) : height(ht), width(wd), contents(ht * ...
    method get (line 20) | char get() const { return contents[cursor]; }
  function main (line 48) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_24.cpp
  class Screen (line 13) | class Screen
    method Screen (line 18) | Screen() = default;
    method Screen (line 20) | Screen(pos ht, pos wd) : height(ht), width(wd), contents(ht * wd, ' ') {}
    method Screen (line 21) | Screen(pos ht, pos wd, char c) : height(ht), width(wd), contents(ht * ...
    method get (line 23) | char get() const { return contents[cursor]; }
  function Screen (line 35) | inline
    method Screen (line 18) | Screen() = default;
    method Screen (line 20) | Screen(pos ht, pos wd) : height(ht), width(wd), contents(ht * wd, ' ') {}
    method Screen (line 21) | Screen(pos ht, pos wd, char c) : height(ht), width(wd), contents(ht * ...
    method get (line 23) | char get() const { return contents[cursor]; }
  function main (line 51) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_27.cpp
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_29.cpp
  class Screen (line 12) | class Screen
    method Screen (line 17) | Screen() = default;
    method Screen (line 19) | Screen(pos ht, pos wd, char c) : height(ht), width(wd), contents(ht * ...
    method get (line 21) | char get() const { return contents[cursor]; }
    method Screen (line 28) | Screen display(std::ostream &os) { do_display(os); return *this; }
    method Screen (line 29) | const Screen display(std::ostream &os) const { do_display(os); return ...
    method do_display (line 33) | void do_display(std::ostream &os) const { os << contents; }
  function Screen (line 42) | inline
    method Screen (line 17) | Screen() = default;
    method Screen (line 19) | Screen(pos ht, pos wd, char c) : height(ht), width(wd), contents(ht * ...
    method get (line 21) | char get() const { return contents[cursor]; }
    method Screen (line 28) | Screen display(std::ostream &os) { do_display(os); return *this; }
    method Screen (line 29) | const Screen display(std::ostream &os) const { do_display(os); return ...
    method do_display (line 33) | void do_display(std::ostream &os) const { os << contents; }
  function Screen (line 58) | inline
    method Screen (line 17) | Screen() = default;
    method Screen (line 19) | Screen(pos ht, pos wd, char c) : height(ht), width(wd), contents(ht * ...
    method get (line 21) | char get() const { return contents[cursor]; }
    method Screen (line 28) | Screen display(std::ostream &os) { do_display(os); return *this; }
    method Screen (line 29) | const Screen display(std::ostream &os) const { do_display(os); return ...
    method do_display (line 33) | void do_display(std::ostream &os) const { os << contents; }
  function Screen (line 65) | inline
    method Screen (line 17) | Screen() = default;
    method Screen (line 19) | Screen(pos ht, pos wd, char c) : height(ht), width(wd), contents(ht * ...
    method get (line 21) | char get() const { return contents[cursor]; }
    method Screen (line 28) | Screen display(std::ostream &os) { do_display(os); return *this; }
    method Screen (line 29) | const Screen display(std::ostream &os) const { do_display(os); return ...
    method do_display (line 33) | void do_display(std::ostream &os) const { os << contents; }
  function main (line 72) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_31.cpp
  class Y (line 12) | class Y
  class X (line 14) | class X
  class Y (line 19) | class Y
  function main (line 24) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_32.cpp
  class Screen (line 13) | class Screen
    method Screen (line 35) | Screen() = default;
    method Screen (line 37) | Screen(pos ht, pos wd, char c) : height(ht), width(wd), contents(ht * ...
    method get (line 39) | char get() const { return contents[cursor]; }
    method Screen (line 46) | Screen &display(std::ostream &os) { do_display(os); return *this; }
    method Screen (line 47) | const Screen &display(std::ostream &os) const { do_display(os); return...
    method do_display (line 51) | void do_display(std::ostream &os) const { os << contents; }
  class Window_mgr (line 14) | class Window_mgr
  class Screen (line 28) | class Screen
    method Screen (line 35) | Screen() = default;
    method Screen (line 37) | Screen(pos ht, pos wd, char c) : height(ht), width(wd), contents(ht * ...
    method get (line 39) | char get() const { return contents[cursor]; }
    method Screen (line 46) | Screen &display(std::ostream &os) { do_display(os); return *this; }
    method Screen (line 47) | const Screen &display(std::ostream &os) const { do_display(os); return...
    method do_display (line 51) | void do_display(std::ostream &os) const { os << contents; }
  function Screen (line 60) | inline
    method Screen (line 35) | Screen() = default;
    method Screen (line 37) | Screen(pos ht, pos wd, char c) : height(ht), width(wd), contents(ht * ...
    method get (line 39) | char get() const { return contents[cursor]; }
    method Screen (line 46) | Screen &display(std::ostream &os) { do_display(os); return *this; }
    method Screen (line 47) | const Screen &display(std::ostream &os) const { do_display(os); return...
    method do_display (line 51) | void do_display(std::ostream &os) const { os << contents; }
  function Screen (line 76) | inline
    method Screen (line 35) | Screen() = default;
    method Screen (line 37) | Screen(pos ht, pos wd, char c) : height(ht), width(wd), contents(ht * ...
    method get (line 39) | char get() const { return contents[cursor]; }
    method Screen (line 46) | Screen &display(std::ostream &os) { do_display(os); return *this; }
    method Screen (line 47) | const Screen &display(std::ostream &os) const { do_display(os); return...
    method do_display (line 51) | void do_display(std::ostream &os) const { os << contents; }
  function Screen (line 83) | inline
    method Screen (line 35) | Screen() = default;
    method Screen (line 37) | Screen(pos ht, pos wd, char c) : height(ht), width(wd), contents(ht * ...
    method get (line 39) | char get() const { return contents[cursor]; }
    method Screen (line 46) | Screen &display(std::ostream &os) { do_display(os); return *this; }
    method Screen (line 47) | const Screen &display(std::ostream &os) const { do_display(os); return...
    method do_display (line 51) | void do_display(std::ostream &os) const { os << contents; }
  function main (line 97) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_35.cpp
  class Exercise (line 16) | class Exercise {
  function main (line 49) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_36.cpp
  type X (line 27) | struct X {
    method X (line 28) | X (int i, int j) : base(i), rem(base % j) {}
  function main (line 33) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_38.cpp
  class Foo (line 16) | class Foo
    method Foo (line 19) | Foo(std::istream &is = std::cin) { is >> a; }
    method print (line 21) | void print() { std::cout << a << std::endl; }
  function main (line 27) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_40.cpp
  class Book (line 17) | class Book
    method Book (line 23) | Book() = default;
    method Book (line 24) | Book(unsigned no, const std::string &name, const std::string &auther, ...
    method Book (line 25) | Book(std::istream &is) { is >> m_no >> m_name >> m_auther >> m_pubdate; }
    method print (line 27) | void print() { std::cout << m_no << " " << m_name << " " << m_auther <...
  function main (line 36) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_41.cpp
  class Sales_data (line 15) | class Sales_data {
    method Sales_data (line 21) | Sales_data(const std::string &s, unsigned n, double p) :
    method Sales_data (line 27) | Sales_data() : Sales_data("", 0, 0.0)
    method Sales_data (line 32) | Sales_data(const std::string &s) : Sales_data(s, 0, 0.0) { }
    method Sales_data (line 34) | Sales_data(std::istream &is) : Sales_data()
    method isbn (line 41) | std::string isbn() const { return bookNo; }
  function Sales_data (line 67) | Sales_data& Sales_data::combine(const Sales_data &rhs)
    method Sales_data (line 21) | Sales_data(const std::string &s, unsigned n, double p) :
    method Sales_data (line 27) | Sales_data() : Sales_data("", 0, 0.0)
    method Sales_data (line 32) | Sales_data(const std::string &s) : Sales_data(s, 0, 0.0) { }
    method Sales_data (line 34) | Sales_data(std::istream &is) : Sales_data()
    method isbn (line 41) | std::string isbn() const { return bookNo; }
  function Sales_data (line 90) | Sales_data add(const Sales_data &lhs, const Sales_data &rhs)
    method Sales_data (line 21) | Sales_data(const std::string &s, unsigned n, double p) :
    method Sales_data (line 27) | Sales_data() : Sales_data("", 0, 0.0)
    method Sales_data (line 32) | Sales_data(const std::string &s) : Sales_data(s, 0, 0.0) { }
    method Sales_data (line 34) | Sales_data(std::istream &is) : Sales_data()
    method isbn (line 41) | std::string isbn() const { return bookNo; }
  function main (line 99) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_42.cpp
  class Book (line 18) | class Book
    method Book (line 21) | Book(unsigned no, const std::string &name, const std::string &auther, ...
    method Book (line 22) | Book() : Book(0, "", "", "") {}
    method Book (line 23) | Book(std::istream &is) : Book() { is >> m_no >> m_name >> m_auther >> ...
    method print (line 25) | void print() { std::cout << m_no << " " << m_name << " " << m_auther <...
  function main (line 36) | int main()

FILE: codes/CppPrimer/ch07_Classes/exercise_7_43.cpp
  class NoDefault (line 13) | class NoDefault
    method NoDefault (line 16) | NoDefault(int) {}
  class C (line 19) | class C
    method C (line 22) | C() : nd(0) {}
  function main (line 27) | int main()

FILE: codes/CppPrimer/ch07_Classes/test_incomplete_type.cpp
  class Child (line 16) | class Child
  class Parent (line 17) | class Parent
  class Child (line 22) | class Child
  function main (line 27) | int main()

FILE: codes/CppPrimer/ch08_The_IO_Library/example_fstream.cpp
  function main (line 11) | int main(int argc, char* argv[])

FILE: codes/CppPrimer/ch08_The_IO_Library/example_istringstream.cpp
  type PersonInfo (line 13) | struct PersonInfo {
  function print (line 19) | void print(const PersonInfo &info)
  function main (line 28) | int main()

FILE: codes/CppPrimer/ch08_The_IO_Library/exercise_8_01.cpp
  function main (line 25) | int main()

FILE: codes/CppPrimer/ch08_The_IO_Library/exercise_8_04.cpp
  function read_func (line 13) | void read_func(const string &file, vector<string> &line_vec)
  function main (line 25) | int main()

FILE: codes/CppPrimer/ch08_The_IO_Library/exercise_8_05.cpp
  function read_func (line 12) | void read_func(const string &file, vector<string> &word_vec)
  function main (line 24) | int main()

FILE: codes/CppPrimer/ch08_The_IO_Library/exercise_8_06.cpp
  function main (line 14) | int main(int argc, char* argv[])

FILE: codes/CppPrimer/ch08_The_IO_Library/exercise_8_07.cpp
  function main (line 12) | int main(int argc, char* argv[])

FILE: codes/CppPrimer/ch08_The_IO_Library/exercise_8_08.cpp
  function main (line 11) | int main(int argc, char* argv[])

FILE: codes/CppPrimer/ch08_The_IO_Library/exercise_8_09.cpp
  function main (line 22) | int main()

FILE: codes/CppPrimer/ch08_The_IO_Library/exercise_8_10.cpp
  function main (line 15) | int main()

FILE: codes/CppPrimer/ch08_The_IO_Library/exercise_8_11.cpp
  type PersonInfo (line 17) | struct PersonInfo {
  function print (line 23) | void print(const PersonInfo &info)
  function main (line 32) | int main()

FILE: codes/CppPrimer/ch08_The_IO_Library/exercise_8_13.cpp
  type PersonInfo (line 12) | struct PersonInfo {
  function print (line 18) | void print(const PersonInfo &info)
  function main (line 27) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/example_capacity_size.cpp
  function main (line 8) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/example_change_container_in_loop.cpp
  function main (line 8) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/example_erase.cpp
  function main (line 8) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/example_forward_list.cpp
  function main (line 8) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/example_insert.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/example_iterator_range.cpp
  function main (line 8) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_02.cpp
  function main (line 10) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_04.cpp
  function find_val (line 13) | bool find_val(VecIt beg, VecIt end, int i)
  function main (line 21) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_05.cpp
  function VecIt (line 13) | VecIt find_val(VecIt beg, VecIt end, int i)
  function main (line 22) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_11.cpp
  function main (line 19) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_13.cpp
  function func_list_to_vector (line 18) | void func_list_to_vector()
  function func_ivec_to_dvec (line 25) | void func_ivec_to_dvec()
  function main (line 32) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_14.cpp
  function main (line 10) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_15.cpp
  function main (line 8) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_16.cpp
  function main (line 10) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_18.cpp
  function main (line 10) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_19.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_20.cpp
  function main (line 18) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_24.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_25.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_26.cpp
  function EraseEvenFromVector (line 18) | void EraseEvenFromVector(vector<int> &vec)
  function EraseOddFromList (line 29) | void EraseOddFromList(list<int> &lst)
  function main (line 40) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_27.cpp
  function main (line 8) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_28.cpp
  function Insert (line 11) | void Insert(forward_list<string> &flst, const string &find_str, const st...
  function main (line 30) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_31.cpp
  function func1 (line 14) | void func1()
  function func2 (line 34) | void func2()
  function main (line 55) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_33.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_34.cpp
  function main (line 20) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_38.cpp
  function main (line 8) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_40.cpp
  function main (line 10) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_41.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_43.cpp
  function replace (line 10) | void replace(string &s, const string &oldVal, const string &newVal)
  function main (line 32) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_44.cpp
  function replace (line 8) | void replace(string &s, const string &oldVal, const string &newVal)
  function main (line 25) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_45.cpp
  function string (line 10) | string func(const string &s, const string &prefix, const string &suffix)
  function main (line 19) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_46.cpp
  function string (line 7) | string func(const string &s, const string &prefix, const string &suffix)
  function main (line 16) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_47.cpp
  function find_num (line 14) | void find_num()
  function find_alpha (line 31) | void find_alpha()
  function main (line 48) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_48.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_49.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_50.cpp
  function func1 (line 10) | void func1()
  function func2 (line 20) | void func2()
  function main (line 30) | int main()

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_51.cpp
  class Date (line 11) | class Date
    method Date (line 14) | Date() = default;
    method Print (line 17) | void Print()
  function main (line 90) | int main(int argc, char *argv[])

FILE: codes/CppPrimer/ch09_Sequential_Containers/exercise_9_52.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/example_back_inserter.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/example_istream_iterator.cpp
  function test1 (line 9) | void test1()
  function test2 (line 26) | void test2()
  function main (line 35) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/example_lambda.cpp
  function biggest (line 10) | void biggest(vector<string> &words, vector<string>::size_type sz)
  function main (line 28) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/example_ostream_iterator.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/example_stable_partition.cpp
  function main (line 7) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/example_stable_sort.cpp
  type Employee (line 9) | struct Employee {
    method Employee (line 10) | Employee(int age, std::string name) : age(age), name(name) {}
  function main (line 21) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/example_unique.cpp
  function elimDups (line 10) | void elimDups(vector<string> &words)
  function main (line 21) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_01.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_02.cpp
  function main (line 10) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_03.cpp
  function main (line 10) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_04.cpp
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_06.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_09.cpp
  function print (line 11) | void print(vector<string> &vec)
  function elimDups (line 18) | void elimDups(vector<string> &words)
  function main (line 31) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_11.cpp
  function isShorter (line 12) | bool isShorter(const string &s1, const string &s2)
  function elimDups (line 17) | void elimDups(vector<string> &words)
  function main (line 30) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_12.cpp
  function compareIsbn (line 14) | bool compareIsbn(const Sales_data &lhs, const Sales_data &rhs)
  function main (line 19) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_13.cpp
  function charMoreThan (line 14) | bool charMoreThan(const string &str)
  function main (line 19) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_14.cpp
  function main (line 7) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_15.cpp
  function main (line 8) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_16.cpp
  function biggest (line 10) | void biggest(vector<string> &words, vector<string>::size_type sz)
  function main (line 28) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_17.cpp
  function main (line 17) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_18.cpp
  function biggest (line 11) | void biggest(vector<string> &words, vector<string>::size_type sz)
  function main (line 26) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_19.cpp
  function biggest (line 11) | void biggest(vector<string> &words, vector<string>::size_type sz)
  function main (line 26) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_20.cpp
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_21.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_22.cpp
  function func (line 12) | bool func(const string &w, size_t n)
  function main (line 17) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_24.cpp
  function check_size (line 13) | bool check_size(const string &s, string::size_type sz)
  function main (line 18) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_25.cpp
  function check_size (line 13) | bool check_size(const string &s, string::size_type sz)
  function biggest (line 18) | void biggest(vector<string> &words, vector<string>::size_type sz)
  function main (line 32) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_27.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_28.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_29.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_30.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_31.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_32.cpp
  function main (line 21) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_33.cpp
  function main (line 16) | int main(int argc, char *argv[])

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_34.cpp
  function main (line 8) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_35.cpp
  function main (line 8) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_36.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_37.cpp
  function main (line 10) | int main()

FILE: codes/CppPrimer/ch10_Generic_Algorithms/exercise_10_42.cpp
  function elimDups (line 11) | void elimDups(list<string> &words)
  function main (line 17) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/example_init_multiset.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/example_make_pair.cpp
  function process (line 10) | pair<string, int>
  function main (line 20) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/example_map.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/example_multimap_find.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/example_set.cpp
  function main (line 10) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/example_unordered_set.cpp
  function hasher (line 10) | size_t hasher(const Sales_data &sd)
  function eqOp (line 15) | bool eqOp(const Sales_data &lhs, const Sales_data &rhs)
  function main (line 20) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/example_word_transform.cpp
  function buildMap (line 12) | map<string, string> buildMap(ifstream &map_file)
  function string (line 27) | const string& transform(const string &s, const map<string, string> &m)
  function word_transform (line 39) | void word_transform(ifstream &map_file, ifstream &input)
  function main (line 59) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/exercise_11_03.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/exercise_11_04.cpp
  function fix (line 12) | void fix(string &word)
  function main (line 25) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/exercise_11_07.cpp
  function add_family (line 13) | void add_family(const string &family_name, Family &family_map)
  function add_child (line 18) | void add_child(const string &family_name, const string &name, Family &fa...
  function main (line 27) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/exercise_11_08.cpp
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/exercise_11_09.cpp
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/exercise_11_11.cpp
  function compareIsbn (line 12) | bool compareIsbn(const Sales_data &lhs, const Sales_data &rhs)
  function main (line 17) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/exercise_11_12.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/exercise_11_13.cpp
  function main (line 15) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/exercise_11_14.cpp
  function add_family (line 16) | void add_family(const string &family_name, Family &family_map)
  function add_child (line 21) | void add_child(const string &family_name,
  function main (line 32) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/exercise_11_17.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/exercise_11_19.cpp
  function compareIsbn (line 15) | bool compareIsbn(const Sales_data &lhs, const Sales_data &rhs)
  function main (line 20) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/exercise_11_20.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/exercise_11_23.cpp
  function add_child (line 16) | void add_child(const string &family_name, const string &name, Family &fa...
  function main (line 21) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/exercise_11_28.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/exercise_11_31.cpp
  function main (line 10) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/exercise_11_32.cpp
  function main (line 14) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/exercise_11_33.cpp
  function buildMap (line 12) | map<string, string> buildMap(ifstream &map_file)
  function string (line 27) | const string& transform(const string &s, const map<string, string> &m)
  function word_transform (line 39) | void word_transform(ifstream &map_file, ifstream &input)
  function main (line 59) | int main()

FILE: codes/CppPrimer/ch11_Associative_Containers/exercise_11_38.cpp
  function main (line 10) | int main()

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_StrBlob/StrBlob.h
  function class (line 9) | class StrBlob {
  function check (line 45) | void StrBlob::check(size_type i, const std::string &msg) const
  function pop_back (line 64) | void StrBlob::pop_back()

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_StrBlob/main.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_StrBlobPtr/ConstStrBlobPtr.h
  function class (line 10) | class ConstStrBlobPtr
  function std (line 32) | inline std::shared_ptr<std::vector<std::string>>
  function std (line 50) | inline const std::string & ConstStrBlobPtr::deref() const
  function std (line 70) | inline const std::string* ConstStrBlobPtr::operator->() const

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_StrBlobPtr/StrBlob.h
  function class (line 12) | class StrBlob {
  function check (line 50) | void StrBlob::check(size_type i, const std::string &msg) const
  function pop_back (line 69) | void StrBlob::pop_back()

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_StrBlobPtr/StrBlobPtr.cpp
  function StrBlobPtr (line 21) | StrBlobPtr operator+(const StrBlobPtr &rhs, size_t n)
  function StrBlobPtr (line 30) | StrBlobPtr operator-(const StrBlobPtr &rhs, size_t n)

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_StrBlobPtr/StrBlobPtr.h
  function class (line 10) | class StrBlobPtr
  function std (line 45) | inline std::shared_ptr<std::vector<std::string>>
  function std (line 63) | inline std::string & StrBlobPtr::deref() const
  function std (line 75) | inline const std::string& StrBlobPtr::operator[](size_t n) const

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_StrBlobPtr/main.cpp
  function func1 (line 9) | void func1()
  function func2 (line 17) | void func2()
  function main (line 26) | int main()

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_TextQuery/QueryResult.cpp
  function ostream (line 5) | ostream &print(ostream &os, const QueryResult &qr)

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_TextQuery/QueryResult.h
  function class (line 10) | class QueryResult {

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_TextQuery/TextQuery.cpp
  function QueryResult (line 27) | QueryResult

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_TextQuery/TextQuery.h
  function class (line 13) | class TextQuery {

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_TextQuery/main.cpp
  function runQueries (line 12) | void runQueries(ifstream &infile)
  function main (line 30) | int main()

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_TextQuery2/QueryResult.cpp
  function ostream (line 5) | ostream &print(ostream &os, const TextQuery::QueryResult &qr)

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_TextQuery2/QueryResult.h
  function class (line 11) | class TextQuery::QueryResult {

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_TextQuery2/TextQuery.h
  function class (line 11) | class TextQuery {

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_TextQuery2/main.cpp
  function runQueries (line 12) | void runQueries(ifstream &infile)
  function main (line 30) | int main()

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_TextQuery_use_StrVec/QueryResult.cpp
  function ostream (line 5) | ostream &print(ostream &os, const QueryResult &qr)

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_TextQuery_use_StrVec/QueryResult.h
  function class (line 12) | class QueryResult {

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_TextQuery_use_StrVec/StrVec.cpp
  function StrVec (line 30) | StrVec &StrVec::operator=(const StrVec &rhs)

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_TextQuery_use_StrVec/StrVec.h
  function class (line 6) | class StrVec

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_TextQuery_use_StrVec/TextQuery.cpp
  function QueryResult (line 26) | QueryResult

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_TextQuery_use_StrVec/TextQuery.h
  function class (line 14) | class TextQuery {

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_TextQuery_use_StrVec/main.cpp
  function runQueries (line 10) | void runQueries(ifstream &infile)
  function main (line 28) | int main()

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_allocator.cpp
  class Bar (line 9) | class Bar
    method Bar (line 12) | Bar() { cout << "Bar()" << endl; }
    method Bar (line 13) | Bar(const Bar&) { cout << "Bar(const Bar&)" << endl; }
  function main (line 17) | int main()

FILE: codes/CppPrimer/ch12_Dynamic_Memory/example_using_own_deletion.cpp
  type destination (line 10) | struct destination
  type connection (line 16) | struct connection
  function connection (line 22) | connection connect(destination *d)
  function disconnect (line 33) | void disconnect(connection c)
  function end_connection (line 41) | void end_connection(connection *p)
  function f (line 46) | void f(destination &d)
  function main (line 56) | int main()

FILE: codes/CppPrimer/ch12_Dynamic_Memory/exercise_12_01.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch12_Dynamic_Memory/exercise_12_06.cpp
  function read_for_vec (line 15) | void read_for_vec(vector<int> *vec)
  function print_vec (line 24) | void print_vec(vector<int> *vec)
  function main (line 33) | int main()

FILE: codes/CppPrimer/ch12_Dynamic_Memory/exercise_12_07.cpp
  function create_vec (line 13) | shared_ptr<vector<int>> create_vec()
  function read_for_vec (line 18) | void read_for_vec(shared_ptr<vector<int>> vec)
  function print_vec (line 27) | void print_vec(shared_ptr<vector<int>> vec)
  function main (line 36) | int main()

FILE: codes/CppPrimer/ch12_Dynamic_Memory/exercise_12_15.cpp
  type destination (line 10) | struct destination
  type connection (line 16) | struct connection
  function connection (line 22) | connection connect(destination *d)
  function disconnect (line 33) | void disconnect(connection c)
  function f (line 40) | void f(destination &d)
  function main (line 50) | int main()

FILE: codes/CppPrimer/ch12_Dynamic_Memory/exercise_12_16.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch12_Dynamic_Memory/exercise_12_20.cpp
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch12_Dynamic_Memory/exercise_12_23.cpp
  function func1 (line 12) | void func1()
  function func2 (line 39) | void func2()
  function main (line 67) | int main()

FILE: codes/CppPrimer/ch12_Dynamic_Memory/exercise_12_24.cpp
  function main (line 10) | int main()

FILE: codes/CppPrimer/ch12_Dynamic_Memory/exercise_12_26.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch12_Dynamic_Memory/exercise_12_27.cpp
  class QueryResult (line 14) | class QueryResult
    method QueryResult (line 19) | QueryResult(const string &word) : m_lines(nullptr), m_line_numbers(nul...
    method IsValid (line 21) | bool IsValid() const { return m_lines && m_line_numbers; }
    method SetRes (line 23) | void SetRes(vector<string> *lines, set<int> *line_numbers)
  class TextQuery (line 35) | class TextQuery
  function QueryResult (line 72) | QueryResult TextQuery::query(const string &word)
    method QueryResult (line 19) | QueryResult(const string &word) : m_lines(nullptr), m_line_numbers(nul...
    method IsValid (line 21) | bool IsValid() const { return m_lines && m_line_numbers; }
    method SetRes (line 23) | void SetRes(vector<string> *lines, set<int> *line_numbers)
  function ostream (line 86) | ostream& print(ostream &os, const QueryResult &query_res)
  function runQueries (line 105) | void runQueries(ifstream &infile)
  function main (line 123) | int main()

FILE: codes/CppPrimer/ch12_Dynamic_Memory/exercise_12_28.cpp
  function main (line 15) | int main()

FILE: codes/CppPrimer/ch12_Dynamic_Memory/exercise_12_32.cpp
  class QueryResult (line 15) | class QueryResult
    method QueryResult (line 20) | QueryResult(const string &word) : m_lines(nullptr), m_line_numbers(nul...
    method IsValid (line 22) | bool IsValid() const { return m_lines && m_line_numbers; }
    method SetRes (line 24) | void SetRes(StrBlob *lines, set<int> *line_numbers)
  class TextQuery (line 36) | class TextQuery
  function QueryResult (line 73) | QueryResult TextQuery::query(const string &word)
    method QueryResult (line 20) | QueryResult(const string &word) : m_lines(nullptr), m_line_numbers(nul...
    method IsValid (line 22) | bool IsValid() const { return m_lines && m_line_numbers; }
    method SetRes (line 24) | void SetRes(StrBlob *lines, set<int> *line_numbers)
  function ostream (line 87) | ostream& print(ostream &os, const QueryResult &query_res)
  function runQueries (line 106) | void runQueries(ifstream &infile)
  function main (line 124) | int main()

FILE: codes/CppPrimer/ch13_Copy_Control/example_Copy_Control/Folder.h
  function class (line 11) | class Folder

FILE: codes/CppPrimer/ch13_Copy_Control/example_Copy_Control/Message.cpp
  function Message (line 58) | Message& Message::operator=(const Message &rhs)
  function Message (line 68) | Message& Message::operator=(Message &&rhs)
  function swap (line 80) | void swap(Message &lhs, Message &rhs)

FILE: codes/CppPrimer/ch13_Copy_Control/example_Copy_Control/Message.h
  function class (line 9) | class Message

FILE: codes/CppPrimer/ch13_Copy_Control/example_Copy_Control/main.cpp
  function main (line 8) | int main()

FILE: codes/CppPrimer/ch13_Copy_Control/example_Reference_Count/HasPtr.h
  function class (line 6) | class HasPtr {
  function swap (line 48) | inline

FILE: codes/CppPrimer/ch13_Copy_Control/example_Reference_Count/main.cpp
  function main (line 7) | int main()

FILE: codes/CppPrimer/ch13_Copy_Control/example_Reference_Qualifier/main.cpp
  class Foo (line 9) | class Foo {
  function Foo (line 23) | Foo &Foo::operator=(const Foo &rhs) &
  function Foo (line 30) | Foo Foo::sorted() &&
  function Foo (line 39) | Foo Foo::sorted() const &
  function Foo (line 49) | Foo &retFoo1()
  function Foo (line 56) | Foo retFoo2()
  function main (line 61) | int main()

FILE: codes/CppPrimer/ch13_Copy_Control/example_StrVec/StrVec.cpp
  function StrVec (line 34) | StrVec& StrVec::operator=(StrVec &&rhs) noexcept
  function StrVec (line 99) | StrVec &StrVec::operator=(const StrVec &rhs)
  function StrVec (line 109) | StrVec &StrVec::operator=(initializer_list<string> il)

FILE: codes/CppPrimer/ch13_Copy_Control/example_StrVec/StrVec.h
  function class (line 10) | class StrVec
  function emplace_back (line 59) | void StrVec::emplace_back(Args&&... args)

FILE: codes/CppPrimer/ch13_Copy_Control/example_StrVec/main.cpp
  function func1 (line 9) | void func1()
  function func2 (line 43) | void func2()
  function func3 (line 55) | void func3()
  function func4 (line 73) | void func4()
  function main (line 84) | int main()

FILE: codes/CppPrimer/ch13_Copy_Control/example_String/String.cpp
  function String (line 61) | String &String::operator=(String &&rhs) noexcept
  function String (line 97) | String &String::operator=(const String &rhs)
  function String (line 109) | String& String::operator=(const char *str)

FILE: codes/CppPrimer/ch13_Copy_Control/example_String/String.h
  function class (line 4) | class String

FILE: codes/CppPrimer/ch13_Copy_Control/example_String/main.cpp
  function func1 (line 10) | void func1()
  function func2 (line 44) | void func2()
  function func3 (line 56) | void func3()
  function func4 (line 65) | void func4()
  function func5 (line 79) | void func5()
  function main (line 96) | int main()

FILE: codes/CppPrimer/ch13_Copy_Control/exercise_13_05.cpp
  class HasPtr (line 10) | class HasPtr {
    method HasPtr (line 12) | HasPtr(const std::string &s = std::string()) :
    method HasPtr (line 15) | HasPtr(const HasPtr &hp) :
  function main (line 22) | int main()

FILE: codes/CppPrimer/ch13_Copy_Control/exercise_13_08.cpp
  class HasPtr (line 9) | class HasPtr {
    method HasPtr (line 11) | HasPtr(const std::string &s = std::string()) :
    method HasPtr (line 14) | HasPtr(const HasPtr &hp) :
    method HasPtr (line 17) | HasPtr& operator=(const HasPtr &hp) {
  function main (line 29) | int main()

FILE: codes/CppPrimer/ch13_Copy_Control/exercise_13_11.cpp
  class HasPtr (line 8) | class HasPtr {
    method HasPtr (line 10) | HasPtr(const std::string &s = std::string()) :
    method HasPtr (line 13) | HasPtr(const HasPtr &hp) :
    method HasPtr (line 16) | HasPtr& operator=(const HasPtr &hp) {
  function main (line 30) | int main()

FILE: codes/CppPrimer/ch13_Copy_Control/exercise_13_13.cpp
  type X (line 14) | struct X {
    method X (line 15) | X() { std::cout << "X()" << std::endl; }
    method X (line 16) | X(const X&) { std::cout << "X(const X&)" << std::endl; }
    method X (line 17) | X& operator=(const X&) { std::cout << "X& operator=(const X&)" << std:...
  function f1 (line 21) | void f1(X)
  function f2 (line 25) | void f2(X&)
  function main (line 29) | int main()

FILE: codes/CppPrimer/ch13_Copy_Control/exercise_13_17.cpp
  function gen_number (line 7) | int gen_number()
  type exercise1 (line 13) | namespace exercise1
    type numbered (line 15) | struct numbered
      method numbered (line 17) | numbered() : mysn(gen_number()) {}
    function f (line 21) | void f(numbered s) { cout << s.mysn << endl; }
  type exercise2 (line 24) | namespace exercise2
    type numbered (line 26) | struct numbered
      method numbered (line 28) | numbered() : mysn(gen_number()) {}
      method numbered (line 29) | numbered(numbered &n) : mysn(gen_number()) {}
    function f (line 33) | void f(numbered s) { cout << s.mysn << endl; }
  type exercise3 (line 36) | namespace exercise3
    type numbered (line 38) | struct numbered
      method numbered (line 40) | numbered() : mysn(gen_number()) {}
      method numbered (line 41) | numbered(numbered &n) : mysn(gen_number()) {}
    function f (line 45) | void f(const numbered &s) { cout << s.mysn << endl; }
  function main (line 48) | int main()

FILE: codes/CppPrimer/ch13_Copy_Control/exercise_13_18.cpp
  class Employee (line 10) | class Employee
    method Employee (line 13) | Employee() : m_id(id_auto) { gen_id(); }
    method Employee (line 14) | Employee(string &name) : m_id(id_auto), m_name(name) { gen_id(); }
    method Print (line 16) | void Print() const { cout << "id: " << m_id << "\tname: " << m_name <<...
    method gen_id (line 19) | static void gen_id() { ++id_auto; }
  function main (line 28) | int main()

FILE: codes/CppPrimer/ch13_Copy_Control/exercise_13_19.cpp
  class Employee (line 11) | class Employee
    method Employee (line 14) | Employee() : m_id(id_auto) { gen_id(); }
    method Employee (line 15) | Employee(string &name) : m_id(id_auto), m_name(name) { gen_id(); }
    method Print (line 17) | void Print() const { cout << "id: " << m_id << "\tname: " << m_name <<...
    method Employee (line 20) | Employee(const Employee&) = delete;
    method Employee (line 21) | Employee& operator=(const Employee&) = delete;
    method gen_id (line 22) | static void gen_id() { ++id_auto; }
  function main (line 31) | int main()

FILE: codes/CppPrimer/ch13_Copy_Control/exercise_13_26.cpp
  class StrBlob (line 9) | class StrBlob {
    method StrBlob (line 13) | StrBlob() : data(std::make_shared<std::vector<std::string>>()) {}
    method StrBlob (line 14) | StrBlob(std::initializer_list<std::string> il) :
    method StrBlob (line 17) | StrBlob(const StrBlob &sb) : data(std::make_shared<std::vector<std::st...
    method StrBlob (line 19) | StrBlob& operator=(const StrBlob &sb)
    method size_type (line 25) | inline size_type size() const { return data->size(); }
    method empty (line 26) | inline bool empty() const { return data->empty(); }
    method push_back (line 29) | inline void push_back(const std::string &t) { data->push_back(t); }
  function main (line 84) | int main()

FILE: codes/CppPrimer/ch13_Copy_Control/exercise_13_28.cpp
  class TreeNode (line 11) | class TreeNode {
    method TreeNode (line 13) | TreeNode(const std::string &s) : value(s), count(0), left(nullptr), ri...
    method TreeNode (line 29) | TreeNode(const TreeNode &node) : value(node.value), count(node.count),...
    method TreeNode (line 36) | TreeNode& operator=(const TreeNode &node)
  class BinStrTree (line 64) | class BinStrTree {
    method BinStrTree (line 66) | BinStrTree() : root(new TreeNode("root")) { cout << "BinStrTree()" << ...
    method BinStrTree (line 70) | BinStrTree(const BinStrTree&) = delete;
    method BinStrTree (line 71) | BinStrTree& operator=(const BinStrTree&) = delete;
    method TreeNode (line 73) | TreeNode Root() const { return *root; }
  function main (line 79) | int main()

FILE: codes/CppPrimer/ch13_Copy_Control/exercise_13_30.cpp
  class HasPtr (line 9) | class HasPtr {
    method HasPtr (line 13) | HasPtr(const std::string &s = std::string()) :
    method HasPtr (line 16) | HasPtr(const HasPtr &hp) :
    method HasPtr (line 19) | HasPtr& operator=(const HasPtr &hp) {
    method Value (line 29) | std::string Value() const { return *ps; }
  function swap (line 35) | void swap(HasPtr &lhs, HasPtr &rhs)
  function main (line 44) | int main()

FILE: codes/CppPrimer/ch13_Copy_Control/exercise_13_31.cpp
  class HasPtr (line 11) | class HasPtr {
    method HasPtr (line 15) | HasPtr(const std::string &s = std::string()) :
    method HasPtr (line 18) | HasPtr(const HasPtr &hp) :
    method Value (line 27) | std::string Value() const { return *ps; }
  function swap (line 33) | void swap(HasPtr &lhs, HasPtr &rhs)
  function HasPtr (line 42) | HasPtr& HasPtr::operator=(HasPtr hp)
    method HasPtr (line 15) | HasPtr(const std::string &s = std::string()) :
    method HasPtr (line 18) | HasPtr(const HasPtr &hp) :
    method Value (line 27) | std::string Value() const { return *ps; }
  function main (line 48) | int main()

FILE: codes/CppPrimer/ch13_Copy_Control/exercise_13_53.cpp
  class HasPtr (line 17) | class HasPtr {
    method HasPtr (line 21) | HasPtr(const std::string &s = std::string()) :
    method HasPtr (line 24) | HasPtr(const HasPtr &hp) :
    method Value (line 35) | std::string Value() const { return *ps; }
  function swap (line 41) | void swap(HasPtr &lhs, HasPtr &rhs)
  function HasPtr (line 58) | HasPtr& HasPtr::operator=(const HasPtr &hp)
    method HasPtr (line 21) | HasPtr(const std::string &s = std::string()) :
    method HasPtr (line 24) | HasPtr(const HasPtr &hp) :
    method Value (line 35) | std::string Value() const { return *ps; }
  function HasPtr (line 70) | HasPtr& HasPtr::operator=(HasPtr &&hp) noexcept
    method HasPtr (line 21) | HasPtr(const std::string &s = std::string()) :
    method HasPtr (line 24) | HasPtr(const HasPtr &hp) :
    method Value (line 35) | std::string Value() const { return *ps; }
  function main (line 83) | int main()

FILE: codes/CppPrimer/ch13_Copy_Control/exercise_13_58.cpp
  class Foo (line 10) | class Foo {
  function Foo (line 24) | Foo &Foo::operator=(const Foo &rhs) &
  function Foo (line 31) | Foo Foo::sorted() &&
  function Foo (line 51) | Foo Foo::sorted() const &
  function Foo (line 59) | Foo &retFoo1()
  function Foo (line 66) | Foo retFoo2()
  function main (line 71) | int main()

FILE: codes/CppPrimer/ch14_Overloaded_Operations_and_Conversions/example_conversion_operators.cpp
  class SmallInt (line 8) | class SmallInt
    method SmallInt (line 11) | SmallInt(int i = 0) : val(i)
  function main (line 27) | int main()

FILE: codes/CppPrimer/ch14_Overloaded_Operations_and_Conversions/example_function-call_operator.cpp
  type AbsInt (line 7) | struct AbsInt
  function main (line 14) | int main()

FILE: codes/CppPrimer/ch14_Overloaded_Operations_and_Conversions/example_function.cpp
  function add (line 12) | int add(int i, int j) { return i + j; }
  type divide (line 16) | struct divide {
  function main (line 24) | int main()

FILE: codes/CppPrimer/ch14_Overloaded_Operations_and_Conversions/example_std_funcobj.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch14_Overloaded_Operations_and_Conversions/exercise_14_05.cpp
  class Book (line 23) | class Book
    method Book (line 29) | Book() = default;
    method Book (line 30) | Book(unsigned no, const std::string &name, const std::string &auther, ...
    method Book (line 31) | Book(std::istream &is) { is >> m_no >> m_name >> m_auther >> m_pubdate; }
    method print (line 33) | void print() { std::cout << m_no << " " << m_name << " " << m_auther <...
  function main (line 57) | int main()

FILE: codes/CppPrimer/ch14_Overloaded_Operations_and_Conversions/exercise_14_24.cpp
  class Book (line 24) | class Book
    method Book (line 30) | Book() = default;
    method Book (line 31) | Book(unsigned no, const std::string &name, const std::string &auther, ...
    method Book (line 32) | Book(std::istream &is) { is >> m_no >> m_name >> m_auther >> m_pubdate; }
    method Book (line 34) | Book& operator=(const Book &lhs)
    method Book (line 43) | Book& operator=(Book &&lhs)
    method print (line 54) | void print() { std::cout << m_no << " " << m_name << " " << m_auther <...
  function main (line 63) | int main()

FILE: codes/CppPrimer/ch14_Overloaded_Operations_and_Conversions/exercise_14_32.cpp
  class Foo (line 12) | class Foo
    method Foo (line 15) | Foo(StrBlobPtr *p) : m_p(p) {}
    method StrBlobPtr (line 17) | StrBlobPtr *operator->()
  function main (line 26) | int main()

FILE: codes/CppPrimer/ch14_Overloaded_Operations_and_Conversions/exercise_14_34.cpp
  type Foo (line 9) | struct Foo
  function main (line 17) | int main()

FILE: codes/CppPrimer/ch14_Overloaded_Operations_and_Conversions/exercise_14_35.cpp
  class ReadString (line 9) | class ReadString
    method ReadString (line 12) | ReadString(istream &is) : m_is(is) {}
    method string (line 13) | string operator()() const
  function main (line 25) | int main()

FILE: codes/CppPrimer/ch14_Overloaded_Operations_and_Conversions/exercise_14_36.cpp
  class ReadString (line 11) | class ReadString
    method ReadString (line 14) | ReadString(istream &is) : m_is(is) {}
    method string (line 15) | string operator()() const
  function main (line 27) | int main()

FILE: codes/CppPrimer/ch14_Overloaded_Operations_and_Conversions/exercise_14_37.cpp
  class Equal (line 10) | class Equal
    method Equal (line 13) | Equal(int cmp) : m_cmp(cmp) {}
  function main (line 20) | int main()

FILE: codes/CppPrimer/ch14_Overloaded_Operations_and_Conversions/exercise_14_38.cpp
  class SizeCmp (line 12) | class SizeCmp
    method SizeCmp (line 15) | SizeCmp(size_t size = 0) : m_size(size) {}
    method SetSize (line 18) | void SetSize(size_t size) { m_size = size; }
  function main (line 24) | int main()

FILE: codes/CppPrimer/ch14_Overloaded_Operations_and_Conversions/exercise_14_39.cpp
  class SizeCmp1 (line 15) | class SizeCmp1
    method SizeCmp1 (line 18) | SizeCmp1(size_t lower, size_t upper) : m_lower(lower), m_upper(upper) {}
  class SizeCmp2 (line 26) | class SizeCmp2
    method SizeCmp2 (line 29) | SizeCmp2(size_t lower) : m_lower(lower) {}
  function main (line 36) | int main()

FILE: codes/CppPrimer/ch14_Overloaded_Operations_and_Conversions/exercise_14_40.cpp
  class Cmp1 (line 13) | class Cmp1
  class Cmp2 (line 22) | class Cmp2
    method Cmp2 (line 25) | Cmp2(size_t sz) : m_sz(sz) {}
  class Printer (line 35) | class Printer
  function biggest (line 44) | void biggest(vector<string> &words, vector<string>::size_type sz)
  function main (line 61) | int main()

FILE: codes/CppPrimer/ch14_Overloaded_Operations_and_Conversions/exercise_14_42.cpp
  function func_a (line 14) | void func_a()
  function func_b (line 24) | void func_b()
  function func_c (line 40) | void func_c()
  function main (line 54) | int main()

FILE: codes/CppPrimer/ch14_Overloaded_Operations_and_Conversions/exercise_14_43.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch14_Overloaded_Operations_and_Conversions/exercise_14_44.cpp
  function Calc (line 12) | void Calc(string ops, int a, int b)
  function main (line 27) | int main(int args, char *argv[])

FILE: codes/CppPrimer/ch14_Overloaded_Operations_and_Conversions/exercise_14_50.cpp
  type LongDouble (line 8) | struct LongDouble {
    method LongDouble (line 9) | LongDouble(double _v = 0.0) : v(_v) {}
  function main (line 16) | int main()

FILE: codes/CppPrimer/ch14_Overloaded_Operations_and_Conversions/exercise_14_51.cpp
  type LongDouble (line 8) | struct LongDouble {
    method LongDouble (line 9) | LongDouble(double _v = 0.0) : v(_v) {}
  function calc (line 16) | void calc(int) { cout << "calc(int)" << endl; }
  function calc (line 17) | void calc(LongDouble) { cout << "calc(LongDouble)" << endl; }
  function main (line 19) | int main()

FILE: codes/CppPrimer/ch14_Overloaded_Operations_and_Conversions/exercise_14_53.cpp
  class SmallInt (line 8) | class SmallInt {
    method SmallInt (line 12) | SmallInt(int _v = 0) : val(_v) {}
  function SmallInt (line 19) | SmallInt operator+(const SmallInt &lhs, const SmallInt &rhs)
    method SmallInt (line 12) | SmallInt(int _v = 0) : val(_v) {}
  function main (line 28) | int main()

FILE: codes/CppPrimer/ch15_Object-Oriented_Programming/example_Access_Control_and_Inheritance/classes.hpp
  class Base (line 4) | class Base {
    method pub_mem (line 8) | void pub_mem() {}
  class Sneaky (line 17) | class Sneaky : public Base {
  class Pal (line 23) | class Pal {
    method f (line 25) | int f(Base b) { return b.prot_mem; }
    method f3 (line 29) | int f3(Sneaky s) { return s.prot_mem; }
  class Pub_Derv (line 32) | class Pub_Derv : public Base {
    method f (line 34) | int f() { return prot_mem; }
  class Priv_Derv (line 40) | class Priv_Derv : private Base {
    method f1 (line 42) | int f1() const { return prot_mem; }
  class Prot_Derv (line 45) | class Prot_Derv : protected Base {
    method f1 (line 47) | int f1() const { return prot_mem; }
  type Derived_from_Public (line 50) | struct Derived_from_Public : public Pub_Derv {
    method use_base (line 52) | int use_base() { return prot_mem; }
  type Derived_from_Private (line 55) | struct Derived_from_Private : public Priv_Derv {
  type Derived_from_Protected (line 60) | struct Derived_from_Protected : public Prot_Derv {
    method use_base (line 62) | int use_base() { return prot_mem; }
  function clobber (line 66) | void clobber(Sneaky &s) { s.j = s.prot_mem = 0; }

FILE: codes/CppPrimer/ch15_Object-Oriented_Programming/example_Access_Control_and_Inheritance/main.cpp
  function main (line 10) | int main()

FILE: codes/CppPrimer/ch15_Object-Oriented_Programming/example_TextQuery/Query.cpp
  function QueryResult (line 5) | QueryResult
  function QueryResult (line 23) | QueryResult
  function QueryResult (line 40) | QueryResult

FILE: codes/CppPrimer/ch15_Object-Oriented_Programming/example_TextQuery/Query.h
  function PrintDebug (line 12) | inline void PrintDebug(const char *msg)
  function class (line 21) | class Query_base {
  function class (line 36) | class WordQuery : public Query_base {
  function class (line 55) | class Query {
  function class (line 86) | class NotQuery : public Query_base {
  function class (line 108) | class BinaryQuery : public Query_base {
  function class (line 125) | class AndQuery : public BinaryQuery {
  function class (line 140) | class OrQuery : public BinaryQuery {

FILE: codes/CppPrimer/ch15_Object-Oriented_Programming/example_TextQuery/QueryResult.cpp
  function ostream (line 5) | ostream &print(ostream &os, const QueryResult &qr, std::pair<size_t, siz...

FILE: codes/CppPrimer/ch15_Object-Oriented_Programming/example_TextQuery/QueryResult.h
  function class (line 10) | class QueryResult {

FILE: codes/CppPrimer/ch15_Object-Oriented_Programming/example_TextQuery/Query_ex15_37.h
  function PrintDebug (line 14) | inline void PrintDebug(const char *msg)
  function class (line 23) | class Query_base {
  function class (line 42) | class WordQuery : public Query_base {
  function class (line 61) | class Query {
  function class (line 97) | class NotQuery : public Query_base {
  function class (line 119) | class BinaryQuery : public Query_base {
  function class (line 136) | class AndQuery : public BinaryQuery {
  function QueryResult (line 143) | QueryResult eval(const TextQuery&) const { return invalid_qr; }
  function class (line 151) | class OrQuery : public BinaryQuery {
  function QueryResult (line 157) | QueryResult eval(const TextQuery&) const { return invalid_qr; }

FILE: codes/CppPrimer/ch15_Object-Oriented_Programming/example_TextQuery/Query_ex15_41.h
  function PrintDebug (line 14) | inline void PrintDebug(const char *msg)
  function class (line 23) | class Query_base {
  function class (line 38) | class WordQuery : public Query_base {
  function class (line 57) | class Query {
  function QueryResult (line 82) | QueryResult eval(const TextQuery &t) const { return q->eval(t); }
  function class (line 103) | class NotQuery : public Query_base {
  function class (line 125) | class BinaryQuery : public Query_base {
  function class (line 142) | class AndQuery : public BinaryQuery {
  function class (line 157) | class OrQuery : public BinaryQuery {

FILE: codes/CppPrimer/ch15_Object-Oriented_Programming/example_TextQuery/TextQuery.cpp
  function FixWord (line 10) | inline void FixWord(string &word)
  function QueryResult (line 40) | QueryResult

FILE: codes/CppPrimer/ch15_Object-Oriented_Programming/example_TextQuery/TextQuery.h
  function class (line 12) | class TextQuery {

FILE: codes/CppPrimer/ch15_Object-Oriented_Programming/example_TextQuery/main.cpp
  function runQueries (line 28) | void runQueries(ifstream &infile)
  function func1 (line 46) | void func1()
  function func2 (line 59) | void func2()
  function func3 (line 66) | void func3()
  function func4 (line 91) | void func4()
  function main (line 108) | int main()

FILE: codes/CppPrimer/ch15_Object-Oriented_Programming/example_abstract_base_class.cpp
  class Quote (line 7) | class Quote {
    method Quote (line 9) | Quote() = default;
    method Quote (line 10) | Quote(const std::string &book, double sales_price) : bookNo(book), pri...
    method isbn (line 12) | std::string isbn() const { return bookNo; }
    method net_price (line 16) | virtual double net_price(std::size_t n) const
  class Disc_quote (line 29) | class Disc_quote : public Quote {
    method Disc_quote (line 31) | Disc_quote() = default;
    method Disc_quote (line 32) | Disc_quote(const std::string& book, double p, std::size_t qty, double ...
  class Bulk_quote (line 42) | class Bulk_quote : public Disc_quote
    method Bulk_quote (line 45) | Bulk_quote() = default;
    method Bulk_quote (line 46) | Bulk_quote(const std::string &book, double p, std::size_t qty, double ...
    method net_price (line 50) | double net_price(std::size_t cnt) const override
  function main (line 59) | int main()

FILE: codes/CppPrimer/ch15_Object-Oriented_Programming/example_base_class.cpp
  class Quote (line 6) | class Quote {
    method Quote (line 8) | Quote() = default;
    method Quote (line 9) | Quote(const std::string &book, double sales_price) : bookNo(book), pri...
    method isbn (line 11) | std::string isbn() const { return bookNo; }
    method net_price (line 15) | virtual double net_price(std::size_t n) const
  function main (line 29) | int main()

FILE: codes/CppPrimer/ch15_Object-Oriented_Programming/example_basket.cpp
  class Quote (line 9) | class Quote
    method Quote (line 12) | Quote() = default;
    method Quote (line 13) | Quote(const std::string &book, double sales_price) : bookNo(book), pri...
    method isbn (line 15) | std::string isbn() const { return bookNo; }
    method net_price (line 19) | virtual double net_price(std::size_t n) const
    method debug (line 24) | virtual void debug() const
    method Quote (line 30) | virtual Quote* clone() const & { return new Quote(*this); }
    method Quote (line 31) | virtual Quote* clone() && { return new Quote(std::move(*this)); }
  class Bulk_quote (line 40) | class Bulk_quote : public Quote // Bulk继承自Quote
    method Bulk_quote (line 43) | Bulk_quote() = default;
    method Bulk_quote (line 44) | Bulk_quote(const std::string &book, double p, std::size_t qty, double ...
    method net_price (line 48) | double net_price(std::size_t cnt) const override
    method debug (line 56) | void debug() const override
    method Bulk_quote (line 63) | Bulk_quote* clone() const & override { return new Bulk_quote(*this); }
    method Bulk_quote (line 64) | Bulk_quote* clone() && override { return new Bulk_quote(std::move(*thi...
  function print_total (line 72) | double print_total(ostream &os, const Quote &item, size_t n)
  class Basket (line 83) | class Basket
    method add_item (line 87) | void add_item(const std::shared_ptr<Quote> &sale) { items.insert(sale); }
    method add_item (line 89) | void add_item(const Quote &sale)
    method add_item (line 92) | void add_item(Quote &&sale)
    method compare (line 100) | static bool compare(const std::shared_ptr<Quote> &lhs, const std::shar...
  function func1 (line 120) | void func1()
  function func2 (line 131) | void func2()
  function main (line 142) | int main()

FILE: codes/CppPrimer/ch15_Object-Oriented_Programming/example_derived_class.cpp
  class Quote (line 9) | class Quote {
    method Quote (line 11) | Quote() = default;
    method Quote (line 12) | Quote(const std::string &book, double sales_price) : bookNo(book), pri...
    method isbn (line 14) | std::string isbn() const { return bookNo; }
    method net_price (line 18) | virtual double net_price(std::size_t n) const
    method debug (line 23) | virtual void debug() const
  class Bulk_quote (line 36) | class Bulk_quote : public Quote // Bulk继承自Quote
    method Bulk_quote (line 39) | Bulk_quote() = default;
    method Bulk_quote (line 40) | Bulk_quote(const std::string &book, double p, std::size_t qty, double ...
    method net_price (line 44) | double net_price(std::size_t cnt) const override
    method debug (line 52) | void debug() const override
  function func1 (line 65) | void func1()
  function func2 (line 79) | void func2()
  function func3 (line 95) | void func3()
  function main (line 110) | int main()

FILE: codes/CppPrimer/ch15_Object-Oriented_Programming/example_derived_class_copy_control_members.cpp
  class Quote (line 7) | class Quote {
    method Quote (line 9) | Quote() { cout << "Quote::Quote()" << endl; }
    method Quote (line 10) | Quote(const std::string &book, double sales_price) : bookNo(book), pri...
    method Quote (line 13) | Quote(const Quote &q) : bookNo(q.bookNo), price(q.price)
    method Quote (line 16) | Quote(Quote &&q) : bookNo(std::move(q.bookNo)), price(q.price)
    method Quote (line 19) | Quote& operator=(const Quote &q)
    method isbn (line 27) | std::string isbn() const { return bookNo; }
    method net_price (line 31) | virtual double net_price(std::size_t n) const
  class Bulk_quote (line 46) | class Bulk_quote : public Quote // Bulk继承自Quote
    method Bulk_quote (line 49) | Bulk_quote() { cout << "Bulk_quote::Bulk_quote()" << endl; }
    method Bulk_quote (line 50) | Bulk_quote(const std::string &book, double p, std::size_t qty, double ...
    method Bulk_quote (line 54) | Bulk_quote(const Bulk_quote &bq) : Quote(bq), min_qty(bq.min_qty), dis...
    method Bulk_quote (line 57) | Bulk_quote(Bulk_quote &&bq) : Quote(std::move(bq)), min_qty(bq.min_qty...
    method Bulk_quote (line 60) | Bulk_quote& operator=(const Bulk_quote &bq)
    method net_price (line 75) | double net_price(std::size_t cnt) const override
  function func (line 89) | void func()
  function main (line 109) | int main()

FILE: codes/CppPrimer/ch15_Object-Oriented_Programming/exercise_15_06.cpp
  class Quote (line 8) | class Quote {
    method Quote (line 10) | Quote() = default;
    method Quote (line 11) | Quote(const std::string &book, double sales_price) : bookNo(book), pri...
    method isbn (line 13) | std::string isbn() const { return bookNo; }
    method net_price (line 17) | virtual double net_price(std::size_t n) const
  class Bulk_quote (line 29) | class Bulk_quote : public Quote // Bulk继承自Quote
    method Bulk_quote (line 32) | Bulk_quote() = default;
    method Bulk_quote (line 33) | Bulk_quote(const std::string &book, double p, std::size_t qty, double ...
    method net_price (line 37) | double net_price(std::size_t cnt) const override
  function print_total (line 51) | double print_total(ostream &os, const Quote &item, size_t n)
  function main (line 62) | int main()

FILE: codes/CppPrimer/ch15_Object-Oriented_Programming/exercise_15_07.cpp
  class Quote (line 9) | class Quote {
    method Quote (line 11) | Quote() = default;
    method Quote (line 12) | Quote(const std::string &book, double sales_price) : bookNo(book), pri...
    method isbn (line 14) | std::string isbn() const { return bookNo; }
    method net_price (line 18) | virtual double net_price(std::size_t n) const
  class Bulk_quote (line 30) | class Bulk_quote : public Quote // Bulk继承自Quote
    method Bulk_quote (line 33) | Bulk_quote() = default;
    method Bulk_quote (line 34) | Bulk_quote(const std::string &book, double p, std::size_t qty, double ...
    method net_price (line 38) | double net_price(std::size_t cnt) const override
  function print_total (line 54) | double print_total(ostream &os, const Quote &item, size_t n)
  function main (line 65) | int main()

FILE: codes/CppPrimer/ch15_Object-Oriented_Programming/exercise_15_16.cpp
  class Quote (line 8) | class Quote {
    method Quote (line 10) | Quote() = default;
    method Quote (line 11) | Quote(const std::string &book, double sales_price) : bookNo(book), pri...
    method isbn (line 13) | std::string isbn() const { return bookNo; }
    method net_price (line 17) | virtual double net_price(std::size_t n) const
  class Disc_quote (line 30) | class Disc_quote : public Quote {
    method Disc_quote (line 32) | Disc_quote() = default;
    method Disc_quote (line 33) | Disc_quote(const std::string& book, double p, std::size_t qty, double ...
  class Bulk_quote (line 44) | class Bulk_quote : public Disc_quote
    method Bulk_quote (line 47) | Bulk_quote() = default;
    method Bulk_quote (line 48) | Bulk_quote(const std::string &book, double p, std::size_t qty, double ...
    method net_price (line 53) | double net_price(std::size_t cnt) const override
  function print_total (line 65) | double print_total(ostream &os, const Quote &item, size_t n)
  function main (line 76) | int main()

FILE: codes/CppPrimer/ch15_Object-Oriented_Programming/exercise_15_18.cpp
  function main (line 17) | int main()

FILE: codes/CppPrimer/ch15_Object-Oriented_Programming/exercise_15_19.cpp
  class Base (line 24) | class Base {
    method pub_mem (line 28) | void pub_mem() {}
    method memfcn (line 36) | void memfcn(Base &b) { b = *this; }
  class Sneaky (line 39) | class Sneaky : public Base {
    method memfcn (line 43) | void memfcn(Base &b) { b = *this; }
  class Pal (line 46) | class Pal {
    method f (line 48) | int f(Base b) { return b.prot_mem; }
    method f3 (line 52) | int f3(Sneaky s) { return s.prot_mem; }
  class Pub_Derv (line 56) | class Pub_Derv : public Base {
    method f (line 58) | int f() { return prot_mem; }
    method memfcn (line 62) | void memfcn(Base &b) { b = *this; }
  class Priv_Derv (line 65) | class Priv_Derv : private Base {
    method f1 (line 67) | int f1() const { return prot_mem; }
    method memfcn (line 68) | void memfcn(Base &b) { b = *this; }
  type Derived_from_Public (line 71) | struct Derived_from_Public : public Pub_Derv {
    method use_base (line 73) | int use_base() { return prot_mem; }
    method memfcn (line 74) | void memfcn(Base &b) { b = *this; }
  type Derive_from_Private (line 77) | struct Derive_from_Private : public Priv_Derv {
  function clobber (line 85) | void clobber(Sneaky &s) { s.j = s.prot_mem = 0; }
  function main (line 90) | int main()

FILE: codes/CppPrimer/ch15_Object-Oriented_Programming/exercise_15_21.cpp
  type SHAPE_TYPE (line 16) | enum SHAPE_TYPE
  class Shape (line 23) | class Shape
    method Shape (line 26) | Shape(int type) : m_type(type) {}
  class Square (line 34) | class Square : public Shape
    method Square (line 37) | Square() : Shape(SHAPE_TYPE_SQUARE), m_height(1), m_width(1) {}
    method Print (line 39) | void Print() const override { printf("[Square] height: %g, width: %g\n...
  class Circle (line 46) | class Circle : public Shape
    method Circle (line 49) | Circle() : Shape(SHAPE_TYPE_CIRCLE), m_radius(1) {}
    method Print (line 51) | void Print() const override { printf("[Circle] radius: %g", m_radius); }
  function main (line 57) | int main()

FILE: codes/CppPrimer/ch15_Object-Oriented_Programming/exercise_15_23.cpp
  class Base (line 11) | class Base {
    method fcn (line 13) | virtual int fcn() { cout << "Base::fcn()" << endl; return 0; }
  class D1 (line 16) | class D1 : public Base {
    method fcn (line 20) | int fcn(int) { cout << "D1::fcn(int)" << endl; return 0; }
    method f2 (line 21) | virtual void f2() { cout << "D1::f2()" << endl; }
    method fcn (line 23) | int fcn() override { cout << "D1::fcn()" << endl; return 0; }
  class D2 (line 26) | class D2 : public D1 {
    method fcn (line 28) | int fcn(int) { cout << "D2::fcn(int)" << endl; return 0; }
    method fcn (line 29) | int fcn() { cout << "D2::fcn()" << endl; return 0; }
    method f2 (line 30) | void f2() { cout << "D2::f2()" << endl; }
  function main (line 33) | int main()

FILE: codes/CppPrimer/ch15_Object-Oriented_Programming/exercise_15_27.cpp
  class Quote (line 7) | class Quote {
    method Quote (line 9) | Quote() = default;
    method Quote (line 10) | Quote(const std::string &book, double sales_price) : bookNo(book), pri...
    method isbn (line 12) | std::string isbn() const { return bookNo; }
    method net_price (line 16) | virtual double net_price(std::size_t n) const
  class Disc_quote (line 29) | class Disc_quote : public Quote {
    method Disc_quote (line 31) | Disc_quote() = default;
    method Disc_quote (line 32) | Disc_quote(const std::string& book, double p, std::size_t qty, double ...
  class Bulk_quote (line 42) | class Bulk_quote : public Disc_quote
    method Bulk_quote (line 45) | Bulk_quote() = default;
    method net_price (line 49) | double net_price(std::size_t cnt) const override
  function main (line 58) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/example_Screen/Screen.h
  function contents (line 26) | Screen(char c) : contents(height * width, c) {}
  function pos (line 28) | pos size() const;

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/example_Screen/main.cpp
  function func1 (line 10) | void func1()
  function func2 (line 19) | void func2()
  function main (line 30) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/example_SmartPointer/UniquePtr.h
  function class (line 4) | class Delete

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/example_SmartPointer/main.cpp
  class Boo (line 9) | class Boo
    method Print (line 13) | void Print() const { cout << "I am Boo" << endl; }
  function Test_SharedPtr (line 16) | void Test_SharedPtr()
  function Test_UniquePtr (line 58) | void Test_UniquePtr()
  function main (line 88) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/example_Vec/Vec.h
  function elemType (line 38) | inline elemType& operator[](std::size_t n) { return elements[n]; }
  function elemType (line 39) | inline const elemType& operator[](std::size_t n) const { return elements...
  function elemType (line 47) | inline elemType *begin() const { return elements; }
  function elemType (line 48) | inline elemType *end() const { return first_free; }
  function chk_n_alloc (line 53) | inline void chk_n_alloc()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/example_Vec/main.cpp
  function func1 (line 10) | void func1()
  function func2 (line 44) | void func2()
  function func3 (line 56) | void func3()
  function func4 (line 74) | void func4()
  function main (line 85) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/example_customer_MakeShared/main.cpp
  class Foo (line 6) | class Foo
    method Foo (line 9) | Foo() { std::cout << "Foo()" << std::endl; }
    method Foo (line 10) | Foo(int, int) { std::cout << "Foo(int, int)" << std::endl; }
  function main (line 14) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/example_explicit_instantiation/Application.cpp
  function func (line 4) | void func()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/example_explicit_instantiation/main.cpp
  function main (line 14) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/example_function_template.cpp
  function compare (line 10) | int compare(const T &v1, const T &v2)
  function compare (line 19) | int compare(const char (&p1)[N], const char (&p2)[N])
  function compare2 (line 26) | int compare2(const T &v1, const T &v2, F f = F()) // 重载会造成二义性调用
  function compare (line 36) | int compare(const char* const &p1, const char* const &p2)
  function main (line 45) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/example_member_template/DebugDelete.h
  function class (line 7) | class DebugDelete {

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/example_member_template/main.cpp
  function func1 (line 8) | void func1()
  function func2 (line 15) | void func2()
  function main (line 22) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/example_overload_and_template.cpp
  function string (line 9) | string debug_rep(const T &t)
  function string (line 18) | string debug_rep(T *p)
  function string (line 31) | string debug_rep(const string &s)
  function string (line 37) | string debug_rep(char *p)
  function string (line 42) | string debug_rep(const char *p)
  function func1 (line 47) | void func1()
  function func2 (line 53) | void func2()
  function func3 (line 59) | void func3()
  function func4 (line 65) | void func4()
  function main (line 70) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/example_template_class/Blob.h
  type typename (line 23) | typedef typename std::vector<T>::size_type size_type;
  function push_back (line 35) | void push_back(const T &t) { data->push_back(t); }
  function push_back (line 39) | void push_back(T &&t) { data->push_back(std::move(t)); }
  function T (line 42) | const T& back() const;

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/example_template_class/main.cpp
  function func1 (line 9) | void func1()
  function func2 (line 15) | void func2()
  function func3 (line 28) | void func3()
  function main (line 37) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/example_variadic_template.cpp
  function foo (line 12) | void foo(const T &t, const Args& ... rest)
  function main (line 19) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/example_variadic_template2.cpp
  function ostream (line 12) | ostream &print(ostream &os, const T &t)
  function ostream (line 19) | ostream &print(ostream &os, const T &t, const Args&... rest)
  function string (line 28) | string debug_rep(const T &t)
  function string (line 37) | string debug_rep(T *p)
  function string (line 50) | string debug_rep(const string &s)
  function string (line 56) | string debug_rep(char *p)
  function string (line 61) | string debug_rep(const char *p)
  function ostream (line 68) | ostream &errorMsg(ostream &os, const Args&... rest)
  function func1 (line 76) | void func1()
  function func2 (line 84) | void func2()
  function func3 (line 98) | void func3()
  function func4 (line 112) | void func4()
  function main (line 121) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/exercise_16_03.cpp
  function compare (line 11) | int compare(const T &v1, const T &v2)
  class Sales_data (line 18) | class Sales_data
  function main (line 22) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/exercise_16_04.cpp
  function It (line 12) | It my_find(It beg, It end, S sought)
  function main (line 23) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/exercise_16_05.cpp
  function print (line 9) | void print(T (&arr)[N])
  function main (line 15) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/exercise_16_06.cpp
  function T (line 11) | T* arr_beg(T (&arr)[N])
  function T (line 17) | T* arr_end(T (&arr)[N])
  function main (line 22) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/exercise_16_07.cpp
  function arr_size (line 8) | constexpr unsigned arr_size(T (&arr)[N])
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/exercise_16_11.cpp
  class ListItem (line 21) | class ListItem
  class List (line 22) | class List {
  function main (line 33) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/exercise_16_18.cpp
  function main (line 35) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/exercise_16_19.cpp
  function print_container (line 8) | void print_container(const Container &container)
  function main (line 18) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/exercise_16_20.cpp
  function print_container (line 11) | void print_container(const Container &container)
  function main (line 18) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/exercise_16_26.cpp
  class NoDefault (line 9) | class NoDefault
    method NoDefault (line 12) | explicit NoDefault(int a) : m_a(a) {}
  function main (line 20) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/exercise_16_29.cpp
  class Blob (line 9) | class Blob
    method Blob (line 23) | Blob() : data(new std::vector<T>()) {}
    method Blob (line 24) | Blob(std::initializer_list<T> il) : data(new std::vector<T>(il)) {}
    method size_type (line 27) | size_type size() const { return data->size(); }
    method empty (line 28) | bool empty() const { return data->empty(); }
    method push_back (line 31) | void push_back(const T &t) { data->push_back(t); }
    method push_back (line 35) | void push_back(T &&t) { data->push_back(std::move(t)); }
  class Blob (line 15) | class Blob {
    method Blob (line 23) | Blob() : data(new std::vector<T>()) {}
    method Blob (line 24) | Blob(std::initializer_list<T> il) : data(new std::vector<T>(il)) {}
    method size_type (line 27) | size_type size() const { return data->size(); }
    method empty (line 28) | bool empty() const { return data->empty(); }
    method push_back (line 31) | void push_back(const T &t) { data->push_back(t); }
    method push_back (line 35) | void push_back(T &&t) { data->push_back(std::move(t)); }
  function T (line 60) | inline T& Blob<T>::back()
  function T (line 67) | inline T& Blob<T>::front()
  function T (line 74) | inline const T& Blob<T>::back() const
  function T (line 81) | inline const T& Blob<T>::front() const
  function T (line 88) | inline T& Blob<T>::operator[](size_type i)
  function T (line 96) | inline const T& Blob<T>::operator[](size_type i) const
  function main (line 110) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/exercise_16_37.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/exercise_16_40.cpp
  function fcn3 (line 13) | auto fcn3(It beg, It end) -> decltype(*beg + 0)
  function main (line 19) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/exercise_16_41.cpp
  function sum (line 10) | long long sum(initializer_list<T> il)
  function main (line 19) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/exercise_16_45.cpp
  function g (line 9) | void g(T&& val) { vector<T> v; }
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/exercise_16_47.cpp
  function flip2 (line 9) | void flip2(F f, T1 &&t1, T2 &&t2)
  function flip (line 15) | void flip(F f, T1 &&t1, T2 &&t2)
  function g1 (line 20) | void g1(int &&i, int &j)
  function main (line 25) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/exercise_16_49.cpp
  function f (line 7) | void f(T) { cout << "f(T)" << endl; }
  function f (line 9) | void f(const T*) { cout << "f(const T*)" << endl; }
  function g (line 11) | void g(T) { cout << "g(T)" << endl; }
  function g (line 13) | void g(T*) { cout << "g(T*)" << endl; }
  function main (line 15) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/exercise_16_55.cpp
  function ostream (line 13) | ostream &print(ostream &os, const T &t, const Args&... rest)
  function ostream (line 22) | ostream &print(ostream &os, const T &t)
  function func1 (line 27) | void func1()
  function main (line 34) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/exercise_16_63.cpp
  function GetOccurTimes (line 13) | int GetOccurTimes(const T &value, const std::vector<T> &vec)
  function GetOccurTimes (line 30) | int GetOccurTimes(const char* const &value, const std::vector<const char...
  function main (line 45) | int main()

FILE: codes/CppPrimer/ch16_Templates_and_GenericProgramming/exercise_16_65.cpp
  function string (line 9) | string debug_rep(const T &t)
  function string (line 18) | string debug_rep(T *p)
  function string (line 31) | string debug_rep(const string &s)
  function string (line 38) | string debug_rep(char *p)
  function string (line 44) | string debug_rep(const char *p)
  function func1 (line 49) | void func1()
  function func2 (line 55) | void func2()
  function func3 (line 61) | void func3()
  function func4 (line 67) | void func4()
  function main (line 75) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/example_formatted_io.cpp
  function func1 (line 10) | void func1()
  function func2 (line 20) | void func2()
  function func3 (line 36) | void func3()
  function func4 (line 46) | void func4()
  function main (line 77) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/example_phone_number.cpp
  function valid (line 9) | bool valid(const smatch &m)
  function main (line 28) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/example_random.cpp
  function func1 (line 12) | void func1()
  function func2 (line 23) | void func2()
  function good_randVec (line 37) | vector<unsigned> good_randVec()
  function func3 (line 53) | void func3()
  function func4 (line 66) | void func4()
  function main (line 83) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/example_regex_error.cpp
  function main (line 8) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/example_regex_replace.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/example_seek_tell.cpp
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/example_sregex_iterator.cpp
  function func1 (line 10) | void func1()
  function func2 (line 29) | void func2()
  function main (line 51) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/example_tuple.cpp
  function compareIsbn (line 19) | bool compareIsbn(const Sales_data &lhs, const Sales_data &rhs)
  function findBook (line 26) | vector<matches>
  function reportResult (line 44) | void reportResult(istream &in, ostream &os, const vector<vector<Sales_da...
  function main (line 62) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/example_unformatted_io.cpp
  function func1 (line 8) | void func1()
  function main (line 15) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/example_using_regex.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/example_using_subexpression.cpp
  function main (line 8) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_01.cpp
  function main (line 8) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_02.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_03.cpp
  class TextQuery (line 18) | class TextQuery {
  function QueryResult (line 49) | QueryResult
  function runQueries (line 76) | void runQueries(std::ifstream &infile)
  function main (line 94) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_05.cpp
  function compareIsbn (line 18) | bool compareIsbn(const Sales_data &lhs, const Sales_data &rhs)
  function findBook (line 25) | vector<matches>
  function reportResult (line 43) | void reportResult(istream &in, ostream &os, const vector<vector<Sales_da...
  function main (line 61) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_06.cpp
  type matches (line 14) | struct matches
  function compareIsbn (line 21) | bool compareIsbn(const Sales_data &lhs, const Sales_data &rhs)
  function findBook (line 28) | vector<matches>
  function reportResult (line 50) | void reportResult(istream &in, ostream &os, const vector<vector<Sales_da...
  function main (line 68) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_09.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_10.cpp
  function func1 (line 14) | void func1()
  function func2 (line 35) | void func2()
  function main (line 48) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_11.cpp
  type QA (line 13) | struct QA
  type QA2 (line 19) | struct QA2
    method QA2 (line 21) | QA2() {}
    method QA2 (line 22) | QA2(const char *bits) : result_bitset(bits) {}
  function main (line 27) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_12.cpp
  type QA (line 11) | struct QA
    method QA (line 13) | QA() {}
    method QA (line 14) | QA(const char *bits) : result_bitset(bits) {}
  function main (line 28) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_13.cpp
  type QA (line 11) | struct QA
    method QA (line 13) | QA() {}
    method QA (line 14) | QA(const char *bits) : result_bitset(bits) {}
  function main (line 28) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_14.cpp
  function error1 (line 9) | void error1()
  function error2 (line 15) | void error2()
  function main (line 26) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_15.cpp
  function InValid (line 11) | bool InValid(const string &word)
  function main (line 26) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_18.cpp
  function main (line 15) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_21.cpp
  function valid (line 13) | bool valid(const smatch &m)
  function CheckPhoneNumber (line 34) | bool CheckPhoneNumber(const string &phone_number)
  type PersonInfo (line 67) | struct PersonInfo {
  function print (line 73) | void print(const PersonInfo &info)
  function main (line 82) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_22.cpp
  function valid (line 11) | bool valid(const smatch &m)
  function main (line 30) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_23.cpp
  function main (line 10) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_25.cpp
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_26.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_27.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_28.cpp
  function Random (line 8) | unsigned int Random()
  function main (line 16) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_29.cpp
  function Random (line 8) | unsigned int Random(int seed)
  function main (line 17) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_30.cpp
  function Random (line 9) | unsigned int Random(int seed, std::pair<int, int> range)
  function main (line 17) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_33.cpp
  function ParseParam (line 19) | void ParseParam(const char *str, std::vector<std::string> &result, const...
  function buildMap (line 36) | map<string, std::vector<string>> buildMap(ifstream &map_file)
  function string (line 62) | const string& Random(const std::vector<std::string> &trans_word)
  function string (line 74) | const string& transform(const string &s, const map<string, std::vector<s...
  function word_transform (line 86) | void word_transform(ifstream &map_file, ifstream &input)
  function main (line 106) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_35.cpp
  function func (line 9) | void func()
  function main (line 16) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_36.cpp
  function func (line 11) | void func(float v)
  function main (line 18) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_37.cpp
  function main (line 9) | int main()

FILE: codes/CppPrimer/ch17_Specialized_Library_Facilities/exercise_17_38.cpp
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch18_Tools_for_Large_Programs/exercise_18_01.cpp
  function func_a (line 12) | void func_a()
  function func_b (line 18) | void func_b()
  function func_bad (line 25) | void func_bad()
  function main (line 32) | int main()

FILE: codes/CppPrimer/ch18_Tools_for_Large_Programs/exercise_18_03.cpp
  function exercise1 (line 12) | void exercise1(int *b, int *e)
  function exercise2 (line 31) | void exercise2(int *b, int *e)
  function main (line 40) | int main()

FILE: codes/CppPrimer/ch18_Tools_for_Large_Programs/exercise_18_05.cpp
  function func_overflow_error (line 14) | void func_overflow_error()
  function func_runtime_error (line 21) | void func_runtime_error()
  function func_exception (line 26) | void func_exception()
  function main (line 32) | int main()

FILE: codes/CppPrimer/ch18_Tools_for_Large_Programs/exercise_18_06.cpp
  class exceptionType (line 9) | class exceptionType {}
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch18_Tools_for_Large_Programs/exercise_18_14.cpp
  type mathLib (line 6) | namespace mathLib {
    type MatrixLib (line 7) | namespace MatrixLib {
      class matrix (line 8) | class matrix { /* ... */ }
  function main (line 16) | int main()

FILE: codes/CppPrimer/ch18_Tools_for_Large_Programs/exercise_18_16.cpp
  type Excercise (line 7) | namespace Excercise {
  function manip (line 18) | void manip() {
  function main (line 34) | int main()

FILE: codes/CppPrimer/ch18_Tools_for_Large_Programs/exercise_18_18.cpp
  type Boo (line 10) | struct Boo
  type Goo (line 15) | struct Goo
  function swap (line 21) | void swap(T v1, T v2)
  function main (line 27) | int main()

FILE: codes/CppPrimer/ch18_Tools_for_Large_Programs/exercise_18_20.cpp
  type primerLib (line 14) | namespace primerLib {
  function compute (line 20) | void compute(int) { std::cout << "compute(int)" << std::endl; }
  function f (line 24) | void f()
  function main (line 29) | int main()

FILE: codes/CppPrimer/ch18_Tools_for_Large_Programs/exercise_18_21.cpp
  class CAD (line 5) | class CAD {}
  class Vehicle (line 6) | class Vehicle {}
  class List (line 7) | class List {}
  class istream (line 8) | class istream {}
  class ostream (line 9) | class ostream {}
  class CADVehicle (line 12) | class CADVehicle : public CAD, Vehicle { }
  class iostream (line 18) | class iostream : public istream, public ostream {}
  function main (line 20) | int main()

FILE: codes/CppPrimer/ch18_Tools_for_Large_Programs/exercise_18_22.cpp
  class A (line 10) | class A { public: A() { cout << "A()" << endl; } }
    method A (line 10) | A() { cout << "A()" << endl; }
  class B (line 11) | class B : public A { public: B() { cout << "B()" << endl; } }
    method B (line 11) | B() { cout << "B()" << endl; }
  class C (line 12) | class C : public B { public: C() { cout << "C()" << endl; } }
    method C (line 12) | C() { cout << "C()" << endl; }
  class X (line 13) | class X { public: X() { cout << "X()" << endl; } }
    method X (line 13) | X() { cout << "X()" << endl; }
  class Y (line 14) | class Y { public: Y() { cout << "Y()" << endl; } }
    method Y (line 14) | Y() { cout << "Y()" << endl; }
  class Z (line 15) | class Z : public X, public Y { public: Z() { cout << "Z()" << endl; } }
    method Z (line 15) | Z() { cout << "Z()" << endl; }
  class MI (line 16) | class MI : public C, public Z { public: MI() { cout << "MI()" << endl; } }
    method MI (line 16) | MI() { cout << "MI()" << endl; }
  function main (line 18) | int main()

FILE: codes/CppPrimer/ch18_Tools_for_Large_Programs/exercise_18_23.cpp
  class A (line 10) | class A { public: A() { cout << "A()" << endl; } }
    method A (line 10) | A() { cout << "A()" << endl; }
  class B (line 11) | class B : public A { public: B() { cout << "B()" << endl; } }
    method B (line 11) | B() { cout << "B()" << endl; }
  class C (line 12) | class C : public B { public: C() { cout << "C()" << endl; } }
    method C (line 12) | C() { cout << "C()" << endl; }
  class X (line 13) | class X { public: X() { cout << "X()" << endl; } }
    method X (line 13) | X() { cout << "X()" << endl; }
  class Y (line 14) | class Y { public: Y() { cout << "Y()" << endl; } }
    method Y (line 14) | Y() { cout << "Y()" << endl; }
  class Z (line 15) | class Z : public X, public Y { public: Z() { cout << "Z()" << endl; } }
    method Z (line 15) | Z() { cout << "Z()" << endl; }
  class MI (line 16) | class MI : public C, public Z { public: MI() { cout << "MI()" << endl; } }
    method MI (line 16) | MI() { cout << "MI()" << endl; }
  class D (line 18) | class D : public X, public C {}
  function main (line 20) | int main()

FILE: codes/CppPrimer/ch18_Tools_for_Large_Programs/exercise_18_25.cpp
  class Base1 (line 12) | class Base1
  class Base2 (line 19) | class Base2
  class D1 (line 26) | class D1 : public Base1
    method print (line 30) | void print() override { cout << "D1::print" << endl; }
  class D2 (line 33) | class D2 : public Base2
    method print (line 37) | void print() override { cout << "D2::print" << endl; }
  class MI (line 40) | class MI : public D1, public D2
    method print (line 44) | void print() override { cout << "MI::print" << endl; }
  function main (line 47) | int main()

FILE: codes/CppPrimer/ch18_Tools_for_Large_Programs/exercise_18_26.cpp
  type Base1 (line 12) | struct Base1 {
    method print (line 13) | void print(int) const {}
  type Base2 (line 16) | struct Base2 {
    method print (line 17) | void print(double) const {}
  type Derived (line 20) | struct Derived : public Base1 {
    method print (line 21) | void print(std::string) const {}
  type MI (line 24) | struct MI : public Derived, public Base2 {
    method print (line 25) | void print(std::vector<double>) {}
  function main (line 28) | int main()

FILE: codes/CppPrimer/ch18_Tools_for_Large_Programs/exercise_18_27.cpp
  type Base1 (line 25) | struct Base1 {
    method print (line 26) | void print(int) const {}
  type Base2 (line 37) | struct Base2 {
    method print (line 38) | void print(double) const {}
  type Derived (line 45) | struct Derived : public Base1 {
    method print (line 46) | void print(std::string) const {}
  type MI (line 52) | struct MI : public Derived, public Base2 {
    method print (line 53) | void print(std::vector<double>) {}
  function main (line 81) | int main()

FILE: codes/CppPrimer/ch18_Tools_for_Large_Programs/exercise_18_28.cpp
  type Base (line 4) | struct Base {
  type Derived1 (line 10) | struct Derived1 : virtual public Base {
  type Derived2 (line 17) | struct Derived2 : virtual public Base {
  class VMI (line 24) | class VMI : public Derived1, public Derived2 {
    method test (line 26) | void test()
  function main (line 44) | int main()

FILE: codes/CppPrimer/ch18_Tools_for_Large_Programs/exercise_18_29.cpp
  class Class (line 7) | class Class {
    method Class (line 9) | Class() { cout << "Class()" << endl; }
  class Base (line 12) | class Base : public Class {
    method Base (line 14) | Base() { cout << "Base()" << endl; }
  class D1 (line 17) | class D1 : virtual public Base {
    method D1 (line 19) | D1() { cout << "D1()" << endl; }
  class D2 (line 22) | class D2 : virtual public Base {
    method D2 (line 24) | D2() { cout << "D2()" << endl; }
  class MI (line 27) | class MI : public D1, public D2 {
    method MI (line 29) | MI() { cout << "MI()" << endl; }
  class Final (line 32) | class Final : public MI, public Class {
    method Final (line 34) | Final() { cout << "Final()" << endl; }
  function func (line 44) | void func()
  function main (line 70) | int main()

FILE: codes/CppPrimer/ch18_Tools_for_Large_Programs/exercise_18_30.cpp
  class Class (line 6) | class Class {
    method Class (line 8) | Class() { cout << "Class()" << endl; }
  class Base (line 11) | class Base : public Class {
    method Base (line 13) | Base() { cout << "Base()" << endl; }
    method Base (line 14) | Base(const Base&) {}
    method Base (line 15) | Base(int) {}
  class D1 (line 18) | class D1 : virtual public Base {
    method D1 (line 20) | D1() { cout << "D1()" << endl; }
    method D1 (line 21) | D1(const D1 &rhs) : Base(rhs) {}
    method D1 (line 22) | D1(int i) : Base(i) {}
  class D2 (line 25) | class D2 : virtual public Base {
    method D2 (line 27) | D2() { cout << "D2()" << endl; }
    method D2 (line 28) | D2(const D2 &rhs) : Base(rhs) {}
    method D2 (line 29) | D2(int i) : Base(i) {}
  class MI (line 32) | class MI : public D1, public D2 {
    method MI (line 34) | MI() { cout << "MI()" << endl; }
    method MI (line 35) | MI(const MI &rhs) : Base(rhs), D1(rhs), D2(rhs) {}
    method MI (line 36) | MI(int i) : Base(i), D1(i), D2(i) {}
  class Final (line 39) | class Final : public MI, public Class {
    method Final (line 41) | Final() { cout << "Final()" << endl; }
    method Final (line 42) | Final(const Final &rhs) : Base(rhs), MI(rhs) {}
    method Final (line 43) | Final(int i) : Base(i), MI(i) {}
  function func (line 46) | void func()
  function main (line 52) | int main()

FILE: codes/CppPrimer/ch19_Specialized_Tools_and_Techniques/example_function_table.cpp
  class Screen (line 7) | class Screen
    method Screen (line 10) | Screen& home() { cout << __FUNCTION__ << endl; return *this; }
    method Screen (line 11) | Screen& forward() { cout << __FUNCTION__ << endl; return *this; }
    method Screen (line 12) | Screen& back() { cout << __FUNCTION__ << endl; return *this; }
    method Screen (line 13) | Screen& up() { cout << __FUNCTION__ << endl; return *this; }
    method Screen (line 14) | Screen& down() { cout << __FUNCTION__ << endl; return *this; }
    type Directions (line 19) | enum Directions { HOME, FORWARD, BACK, UP, DOWN }
  function Screen (line 34) | Screen& Screen::move(Directions dir)
    method Screen (line 10) | Screen& home() { cout << __FUNCTION__ << endl; return *this; }
    method Screen (line 11) | Screen& forward() { cout << __FUNCTION__ << endl; return *this; }
    method Screen (line 12) | Screen& back() { cout << __FUNCTION__ << endl; return *this; }
    method Screen (line 13) | Screen& up() { cout << __FUNCTION__ << endl; return *this; }
    method Screen (line 14) | Screen& down() { cout << __FUNCTION__ << endl; return *this; }
    type Directions (line 19) | enum Directions { HOME, FORWARD, BACK, UP, DOWN }
  function main (line 39) | int main()

FILE: codes/CppPrimer/ch19_Specialized_Tools_and_Techniques/example_memfunc_as_callable_obj.cpp
  function method1 (line 10) | void method1()
  function method2 (line 27) | void method2()
  function method3 (line 43) | void method3()
  function main (line 60) | int main()

FILE: codes/CppPrimer/ch19_Specialized_Tools_and_Techniques/example_placement_new.cpp
  type Foo (line 5) | struct Foo
    method Foo (line 7) | Foo(int _a, int _b) : a(_a), b(_b) { std::cout << "Foo::Foo()\n"; }
  function main (line 12) | int main()

FILE: codes/CppPrimer/ch19_Specialized_Tools_and_Techniques/example_pointer_to_member.cpp
  class Screen (line 6) | class Screen
    method Screen (line 11) | Screen(const std::string &_contents) : contents(_contents), cursor(0),...
    method get_cursor (line 13) | char get_cursor() const { return contents[cursor]; }
  function main (line 27) | int main()

FILE: codes/CppPrimer/ch19_Specialized_Tools_and_Techniques/example_type_info.cpp
  function main (line 6) | int main()

FILE: codes/CppPrimer/ch19_Specialized_Tools_and_Techniques/example_union_with_class.cpp
  class Token (line 9) | class Token {
    method Token (line 14) | Token() : tok(INT), ival(0) {}
    method Token (line 15) | Token(const Token& t) : tok(t.tok) { copyUnion(t); }
    method Token (line 17) | Token(Token &&t) : tok(t.tok) { moveCopyUnion(std::move(t)); }
  function Token (line 49) | Token& Token::operator=(int i)
    method Token (line 14) | Token() : tok(INT), ival(0) {}
    method Token (line 15) | Token(const Token& t) : tok(t.tok) { copyUnion(t); }
    method Token (line 17) | Token(Token &&t) : tok(t.tok) { moveCopyUnion(std::move(t)); }
  function Token (line 59) | Token& Token::operator=(char c)
    method Token (line 14) | Token() : tok(INT), ival(0) {}
    method Token (line 15) | Token(const Token& t) : tok(t.tok) { copyUnion(t); }
    method Token (line 17) | Token(Token &&t) : tok(t.tok) { moveCopyUnion(std::move(t)); }
  function Token (line 68) | Token& Token::operator=(double d)
    method Token (line 14) | Token() : tok(INT), ival(0) {}
    method Token (line 15) | Token(const Token& t) : tok(t.tok) { copyUnion(t); }
    method Token (line 17) | Token(Token &&t) : tok(t.tok) { moveCopyUnion(std::move(t)); }
  function Token (line 77) | Token& Token::operator=(const std::string &s)
    method Token (line 14) | Token() : tok(INT), ival(0) {}
    method Token (line 15) | Token(const Token& t) : tok(t.tok) { copyUnion(t); }
    method Token (line 17) | Token(Token &&t) : tok(t.tok) { moveCopyUnion(std::move(t)); }
  function Token (line 88) | Token& Token::operator=(const Sales_data &sd)
    method Token (line 14) | Token() : tok(INT), ival(0) {}
    method Token (line 15) | Token(const Token& t) : tok(t.tok) { copyUnion(t); }
    method Token (line 17) | Token(Token &&t) : tok(t.tok) { moveCopyUnion(std::move(t)); }
  function Token (line 124) | Token& Token::operator=(const Token &t)
    method Token (line 14) | Token() : tok(INT), ival(0) {}
    method Token (line 15) | Token(const Token& t) : tok(t.tok) { copyUnion(t); }
    method Token (line 17) | Token(Token &&t) : tok(t.tok) { moveCopyUnion(std::move(t)); }
  function Token (line 141) | Token& Token::operator=(Token &&t)
    method Token (line 14) | Token() : tok(INT), ival(0) {}
    method Token (line 15) | Token(const Token& t) : tok(t.tok) { copyUnion(t); }
    method Token (line 17) | Token(Token &&t) : tok(t.tok) { moveCopyUnion(std::move(t)); }
  function ostream (line 158) | ostream& operator<<(ostream &os, Token &t)
  function main (line 172) | int main()

FILE: codes/CppPrimer/ch19_Specialized_Tools_and_Techniques/example_use_RTTI.cpp
  class Base (line 6) | class Base {
    method equal (line 12) | virtual bool equal(const Base& rhs) const
  class Derived (line 22) | class Derived : public Base {
    method equal (line 27) | bool equal(const Base& rhs) const override
  function main (line 45) | int main()

FILE: codes/CppPrimer/ch19_Specialized_Tools_and_Techniques/exercise_19_01.cpp
  function main (line 22) | int main()

FILE: codes/CppPrimer/ch19_Specialized_Tools_and_Techniques/exercise_19_03.cpp
  class A (line 6) | class A { public: virtual ~A() {} }
  class B (line 7) | class B : public A {}
  class C (line 8) | class C : public B {}
  class D (line 9) | class D : public A {}
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch19_Specialized_Tools_and_Techniques/exercise_19_04.cpp
  class A (line 6) | class A { public: virtual ~A() {} }
  class B (line 7) | class B : public A {}
  class C (line 8) | class C : public B {}
  class D (line 9) | class D : public A {}
  function main (line 11) | int main()

FILE: codes/CppPrimer/ch19_Specialized_Tools_and_Techniques/exercise_19_06.cpp
  class Query_base (line 8) | class Query_base
  class AndQuery (line 14) | class AndQuery : public Query_base
  function main (line 18) | int main()

FILE: codes/CppPrimer/ch19_Specialized_Tools_and_Techniques/exercise_19_07.cpp
  class Query_base (line 7) | class Query_base
  class AndQuery (line 13) | class AndQuery : public Query_base
  function main (line 17) | int main()

FILE: codes/CppPrimer/ch19_Specialized_Tools_and_Techniques/exercise_19_08.cpp
  class Query_base (line 7) | class Query_base
  class AndQuery (line 13) | class AndQuery : public Query_base
  function main (line 17) | int main()

FILE: codes/CppPrimer/ch19_Specialized_Tools_and_Techniques/exercise_19_10.cpp
  class A (line 9) | class A { public: virtual ~A() {} }
  class B (line 10) | class B : public A {}
  class C (line 11) | class C : public B {}
  function main (line 13) | int main()

FILE: codes/CppPrimer/ch19_Specialized_Tools_and_Techniques/exercise_19_12.cpp
  class Screen (line 7) | class Screen
    method Screen (line 12) | Screen(const std::string &_contents) : contents(_contents), cursor(0),...
    method get_cursor (line 14) | char get_cursor() const { return contents[cursor]; }
    method pos (line 22) | static const pos Screen::*pcursor()
  function main (line 31) | int main()

FILE: codes/CppPrimer/ch19_Specialized_Tools_and_Techniques/exercise_19_13.cpp
  function main (line 6) | int main()

FILE: codes/CppPrimer/ch19_Specialized_Tools_and_Techniques/exercise_19_14.cpp
  class Screen (line 12) | class Screen
    method get_cursor (line 15) | char get_cursor() const { return 0; }
    method get (line 16) | char get(unsigned w, unsigned h) const { return 0; }
  function main (line 19) | int main()

FILE: codes/CppPrimer/ch19_Specialized_Tools_and_Techniques/exercise_19_18.cpp
  function func (line 10) | void func()
  function main (line 20) | int main()

FILE: codes/CppPrimer/ch19_Specialized_Tools_and_Techniques/exercise_19_19.cpp
  function func (line 11) | void func()
  function main (line 33) | int main()

FILE: codes/CppPrimer/ch19_Specialized_Tools_and_Techniques/exercise_19_26.cpp
  function main (line 9) | int main()
Condensed preview — 2098 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,027K chars).
[
  {
    "path": ".gitignore",
    "chars": 24,
    "preview": "site/\nnohup.out\n.vscode/"
  },
  {
    "path": "auto_refresh_mkdocs_site.sh",
    "chars": 158,
    "preview": "#! /bin/bash\n\nwhile true; do\n\tsleep 3\n\n\tif git pull origin master | grep '^Updating' ; then\n\n\t\techo \"[$(date)] mkdocs gh"
  },
  {
    "path": "codes/CProgramming/README.md",
    "chars": 17819,
    "preview": "# C语言程序设计:现代方法\n\n学习环境:CentOS 7, VS Code & MinGW & Git-Bash\n\n第25章 测试多字符与宽字符采取的环境是 CentOS7 ,在 Windows 下测试会出现问题\n\n---\n\n## 练习题"
  },
  {
    "path": "codes/CProgramming/ch02_C语言基本概念/build.sh",
    "chars": 640,
    "preview": "#! /bin/bash\n\n# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]\n\nall_c_files=`ls *.c`\nexclude_files=\"\"\n\nis_exclude_file() "
  },
  {
    "path": "codes/CProgramming/ch02_C语言基本概念/celsius.c",
    "chars": 364,
    "preview": "/* Converts a Fahrenheit temperature to Celsius */\n\n#include <stdio.h>\n\n#define FREEZING_PT 32.0f\n#define SCALE_FACTOR ("
  },
  {
    "path": "codes/CProgramming/ch02_C语言基本概念/dweight.c",
    "chars": 422,
    "preview": "/* Computes the dimensional weight of a 12 * 10 * 8 box */\n\n#include <stdio.h>\n\nint main()\n{\n\tint length, width, height,"
  },
  {
    "path": "codes/CProgramming/ch02_C语言基本概念/dweight2.c",
    "chars": 493,
    "preview": "/* Computes the dimensional weight of a 12 * 10 * 8 box */\n\n#include <stdio.h>\n\nint main()\n{\n\tint length, width, height,"
  },
  {
    "path": "codes/CProgramming/ch02_C语言基本概念/ex_01.c",
    "chars": 428,
    "preview": "/*\n * 建立并运行由 Kernighan 和 Ritchie 编写的著名的”hello, world“程序:\n *\n * #include <stdio.h>\n *\n * main()\n * {\n *     printf(\"hello"
  },
  {
    "path": "codes/CProgramming/ch02_C语言基本概念/ex_02.c",
    "chars": 534,
    "preview": "/*\n思考下面的程序:\n\n#include <stdio.h>\n\nmain()\n{\n\tprintf(\"Parkinson's Law:\\nWork expands so as to \");\n\tprintf(\"fill the time\\n"
  },
  {
    "path": "codes/CProgramming/ch02_C语言基本概念/ex_03.c",
    "chars": 275,
    "preview": "/*\n * 编写一个程序,程序要使用 printf 在屏幕上显示出下面的图形:\n *\n *        *\n *       *\n *      *\n * *   *\n *  * *\n *   *\n */\n\n#include <stdio"
  },
  {
    "path": "codes/CProgramming/ch02_C语言基本概念/ex_04.c",
    "chars": 488,
    "preview": "/*\n通过下列方法缩写程序dweight.c: (1)用初始化语句替换对变量height、length和width的赋值语句;\n(2)去掉变量weight,在最后的printf语句中计算(valoume + 165) / 166。\n*/\n\n"
  },
  {
    "path": "codes/CProgramming/ch02_C语言基本概念/ex_05.c",
    "chars": 321,
    "preview": "/*\n * 编写一个计算球体体积的程序,其中球体半径为10m,参考公式v=4/3πr3。注意,分数4/3应写为\n * 4.0/3.0。(如果分数写成4/3,会产生什么结果?)\n */\n\n/*\n * 如果写成4/3,那么结果恒等于1,不是正确"
  },
  {
    "path": "codes/CProgramming/ch02_C语言基本概念/ex_06.c",
    "chars": 294,
    "preview": "/*\n * 编写一个程序用来声明几个 int 型和 float 型变量,不对这些变量进行初始化,然后打印出它们的值。\n * 这些值是否有规律?(通常情况下没有)\n */\n\n/*\n * 没有规律。\n */\n\n#include <stdio.h"
  },
  {
    "path": "codes/CProgramming/ch02_C语言基本概念/ex_07.c",
    "chars": 265,
    "preview": "/*\n * 修改练习5中的程序,使用户可以自行录入球体的半径。\n */\n\n#include <stdio.h>\n\n#define PI 3.14\n\nint main()\n{\n\tfloat radius, volume;\n\n\tprintf(\""
  },
  {
    "path": "codes/CProgramming/ch02_C语言基本概念/ex_08.c",
    "chars": 324,
    "preview": "/*\n * 编写一个程序,要求用户输入一个美金数量,然后显示出加了5%税率的相应金额。格式如下所示:\n * Enter a dollar amount: 100.00\n * With tax added: 105.00\n */\n\n#incl"
  },
  {
    "path": "codes/CProgramming/ch02_C语言基本概念/ex_09.md",
    "chars": 31,
    "preview": "修改练习7,要求用名为 PI 的宏表示π的值。\n\n见练习7。\n"
  },
  {
    "path": "codes/CProgramming/ch02_C语言基本概念/ex_10.c",
    "chars": 261,
    "preview": "/*\n * 判断下列哪些是不合法的C语言标识符?\n * (a) 100_bottles\n * (b) _100_bottles\n * (c) one_hundred_bottles\n * (d) bottles_by_the_hundred"
  },
  {
    "path": "codes/CProgramming/ch02_C语言基本概念/ex_11.md",
    "chars": 79,
    "preview": "判断下列哪些是C语言的关键字?\n\n(a) for 是\n\n(b) If 不是\n\n(c) main 不是\n\n(d) printf 不是\n\n(e) while 是\n"
  },
  {
    "path": "codes/CProgramming/ch02_C语言基本概念/ex_12.md",
    "chars": 114,
    "preview": "下面的语句中有多少记号?\n\n```c\na=(3*q-p*p)/3;\n```\n\n有:\n\n1. a\n2. (\n3. 3\n4. \\*\n5. q\n6. -\n7. p\n8. \\*\n9. p\n10. )\n11. /\n12. 3\n13. ;\n"
  },
  {
    "path": "codes/CProgramming/ch02_C语言基本概念/ex_13.md",
    "chars": 67,
    "preview": "在练习12的记号之间插入足够多的空格,使得上面的语句易于阅读。\n\n```c\na = (3 * q - p * p) / 3;\n```\n"
  },
  {
    "path": "codes/CProgramming/ch02_C语言基本概念/pun.c",
    "chars": 201,
    "preview": "/*\n * Name: pun.c\n * Purpose: Prints a bad pun.\n * Author: liudiwen\n * Date written: 28/8/2018\n */\n\n#include <stdio.h>\n\n"
  },
  {
    "path": "codes/CProgramming/ch03_格式化的输入输出/addfrac.c",
    "chars": 452,
    "preview": "/* Add two fractions */\n\n#include <stdio.h>\n\nint main()\n{\n    int num1, denom1;\n    int num2, denom2;\n    int result_num"
  },
  {
    "path": "codes/CProgramming/ch03_格式化的输入输出/build.sh",
    "chars": 640,
    "preview": "#! /bin/bash\n\n# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]\n\nall_c_files=`ls *.c`\nexclude_files=\"\"\n\nis_exclude_file() "
  },
  {
    "path": "codes/CProgramming/ch03_格式化的输入输出/ex_01.c",
    "chars": 344,
    "preview": "/*\n * 下面的 printf 函数调用产生的输出分别是什么?\n */\n\n#include <stdio.h>\n\nint main()\n{\n\t// `代表空格\n\n\t// a: ````86,1040\n\tprintf(\"%6d,%4d\", "
  },
  {
    "path": "codes/CProgramming/ch03_格式化的输入输出/ex_02.c",
    "chars": 373,
    "preview": "/*\n * 编写 printf 函数调用以下列格式来显示 float 型变量x:\n */\n\n#include <stdio.h>\n\nint main()\n{\n\tfloat x = 3.14;\n\n\t// (a) 指数表示形式;最小为8的字段宽"
  },
  {
    "path": "codes/CProgramming/ch03_格式化的输入输出/ex_03.c",
    "chars": 680,
    "preview": "/*\n * 说明下列每对 scanf 格式串是否等价?如果不等价,请指出它们的差异。\n */\n\n#include <stdio.h>\n\nint main()\n{\n\tint i, j, k;\n\tfloat x, y;\n\n\t// (a) \"%d"
  },
  {
    "path": "codes/CProgramming/ch03_格式化的输入输出/ex_04.c",
    "chars": 365,
    "preview": "/*\n * 编写一个程序,接收用户录入的日期信息并且将其显示出来。其中,输入日期的形式为月/日/年(即\n * mm/dd/yy),输出日期的形式为年月日(即yymmdd)。格式如下所示:\n * Enter a date (mm/dd/yy)"
  },
  {
    "path": "codes/CProgramming/ch03_格式化的输入输出/ex_05.c",
    "chars": 773,
    "preview": "/*\n * 编写一个程序,对用户录入的产品信息进行格式化。程序运行后需有如下会话:\n * Enter item number: 583\n * Enter unit price: 13.5\n * Enter purchase date (mm"
  },
  {
    "path": "codes/CProgramming/ch03_格式化的输入输出/ex_06.c",
    "chars": 745,
    "preview": "/*\n * 图书用国际标准图书编号( ISBN )进行标识,如0-393-30375-6。编号中的第一个数字说明编写书籍\n * 所用的语言(例如,0表示英语,3表示德语)。接下来的一组数字表示出版社(例如,393是 W.W.Norton\n "
  },
  {
    "path": "codes/CProgramming/ch03_格式化的输入输出/ex_07.c",
    "chars": 306,
    "preview": "/*\n * 假设 scanf 函数调用的格式如下:\n * scanf(\"%d%f%d\", &i, &x, &j);\n * 如果用户录入如下信息:\n * 10.3 5 6\n * 调用执行后,变量i、x和j的值分别是多少?(假设变量i和变量j都"
  },
  {
    "path": "codes/CProgramming/ch03_格式化的输入输出/ex_08.c",
    "chars": 314,
    "preview": "/*\n * 假设 scanf 函数调用的格式如下:\n * scanf(\"%f%d%f\", &x, &i, &y);\n * 如果用户录入如下信息:\n * 12.3 45.6 789\n * 调用执行后,变量x、i和y的值分别是多少?(假设变量x"
  },
  {
    "path": "codes/CProgramming/ch03_格式化的输入输出/example_escape_sequence.c",
    "chars": 192,
    "preview": "/*\n * 转移序列案例,见 p25\n */\n\n#include <stdio.h>\n\nint main()\n{\n\tprintf(\"Item\\tUnit\\tPurchase\\n\\tPrice\\tDate\\n\");\n\n\tprintf(\"\\\"H"
  },
  {
    "path": "codes/CProgramming/ch03_格式化的输入输出/example_scanf.c",
    "chars": 228,
    "preview": "/*\n * scanf 案例,见 p26\n */\n\n#include <stdio.h>\n\nint main()\n{\n\tint i, j;\n\tfloat x, y;\n\t\n\tscanf(\"%d%d%f%f\", &i, &j, &x, &y);"
  },
  {
    "path": "codes/CProgramming/ch03_格式化的输入输出/stocks.c",
    "chars": 392,
    "preview": "/*\n * Computes the value of stock holdings\n */\n\n#include <stdio.h>\n\nint main()\n{\n\tint price, shares;\n\tfloat num, denom, "
  },
  {
    "path": "codes/CProgramming/ch03_格式化的输入输出/tprintf.c",
    "chars": 254,
    "preview": "/* Print int and float values in various formats */\n\n#include <stdio.h>\n\nint main()\n{\n    int i;\n    float x;\n\n    i = 4"
  },
  {
    "path": "codes/CProgramming/ch04_表达式/build.sh",
    "chars": 640,
    "preview": "#! /bin/bash\n\n# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]\n\nall_c_files=`ls *.c`\nexclude_files=\"\"\n\nis_exclude_file() "
  },
  {
    "path": "codes/CProgramming/ch04_表达式/ex_01.c",
    "chars": 489,
    "preview": "/*\n * 列出下列每段代码的输出结果。假设i、j和k都是 int 型变量。\n */\n\n#include <stdio.h>\n\nint main()\n{\n\tint i, j, k;\n\n\t/*\n\t * (a) 1 2\n\t */\n\t{\n\t\ti "
  },
  {
    "path": "codes/CProgramming/ch04_表达式/ex_02.c",
    "chars": 271,
    "preview": "/*\n * 如果i和j都是正整数,是否(-i)/j的值和-(i/j)的值始终一样?验证你的答案。\n *\n * 一样。\n */\n\n#include <stdio.h>\n\nint main()\n{\n\tint i, j;\n\n\tprintf(\"En"
  },
  {
    "path": "codes/CProgramming/ch04_表达式/ex_03.c",
    "chars": 293,
    "preview": "/*\n * 编写程序实现数字反向,即根据用户输入的两位数,反向显示出该数相应位上数字。要求程序执行过\n * 程中需要具有下列显示信息。\n *\n * Enter a two-degit number: 28\n * The reversal i"
  },
  {
    "path": "codes/CProgramming/ch04_表达式/ex_04.c",
    "chars": 214,
    "preview": "/*\n * 扩展练习3中的程序使其可以处理三位数的反向。\n */\n\n#include <stdio.h>\n\nint main()\n{\n\tint n;\n\n\tprintf(\"Enter a three-digit number: \" );\n\ts"
  },
  {
    "path": "codes/CProgramming/ch04_表达式/ex_05.c",
    "chars": 263,
    "preview": "/*\n * 重新编写练习4中的程序,使新程序不用数学式的分割数字方法就可以显示出三位的反向数。提示:\n * 复习程序upc.c。\n */\n\n#include <stdio.h>\n\nint main()\n{\n\tint d1, d2, d3;\n"
  },
  {
    "path": "codes/CProgramming/ch04_表达式/ex_06.c",
    "chars": 537,
    "preview": "/*\n * 列出下列每段代码的输出结果。假设i、j和k都是 int 型变量。\n */\n\n#include <stdio.h>\n\nint main()\n{\n\tint i, j, k;\n\n\t/*\n\t * (a) 63 8\n\t */\n\t{\n\t\ti"
  },
  {
    "path": "codes/CProgramming/ch04_表达式/ex_07.c",
    "chars": 563,
    "preview": "/*\n * 列出下列每段代码的输出结果。假设i、j和k都是 int 型变量。\n */\n\n#include <stdio.h>\n\nint main()\n{\n\tint i, j, k;\n\n\t/*\n\t * (a) 0 2\n\t */\n\t{\n\t\ti "
  },
  {
    "path": "codes/CProgramming/ch04_表达式/ex_08.c",
    "chars": 222,
    "preview": "/*\n * 表达式++i和i++中只有一个是与表达式(i += 1)完全相同的,哪一个是呢?验证你的答案。\n *\n * ++i\n */\n\n#include <stdio.h>\n\nint main()\n{\n\tint i;\n\n\ti = 1;\n\t"
  },
  {
    "path": "codes/CProgramming/ch04_表达式/ex_09.md",
    "chars": 205,
    "preview": "用圆括号来显示C语言编译器解释下列表达式的方法。\n\n(a) a * b - c * d + e\n\n((a * b) - (c * d)) + e\n\n(b) a / b % c / d\n\n((a / b) % c) / d\n\n(c) - a "
  },
  {
    "path": "codes/CProgramming/ch04_表达式/ex_10.c",
    "chars": 318,
    "preview": "/*\n * 表达式(i++)+ (i--)共有多少种可能的值?假设i初始值为1,这些值都是什么?\n *\n * 先执行第一个表达式,且i已修改,结果为 1 + 2 = 3\n * 先执行第一个表达式,但i未修改,结果为 1 + 1 = 2\n *"
  },
  {
    "path": "codes/CProgramming/ch04_表达式/ex_11.md",
    "chars": 173,
    "preview": "请描述执行下列每条表达式语句后的效果。(假设i的初始值为1,j的初始值为2。)\n\n(a) i += j; 表达式结果为3,副作用是把i的值修改成3\n\n(b) i--; 表达式的结果为1,副作用是把i的值修改成0\n\n(b) i * j / i"
  },
  {
    "path": "codes/CProgramming/ch04_表达式/upc.c",
    "chars": 706,
    "preview": "/* Computes a Universal Product Code check digit */\n\n/* Enter: 0 13800 15173 \n * Check: 5\n */\n\n#include <stdio.h>\n\nint m"
  },
  {
    "path": "codes/CProgramming/ch05_选择语句/broker.c",
    "chars": 636,
    "preview": "/* Calculates a brokers commision */\n\n#include <stdio.h>\n\nint main()\n{\n\tfloat value, commision;\n\n\tprintf(\"Enter value of"
  },
  {
    "path": "codes/CProgramming/ch05_选择语句/build.sh",
    "chars": 640,
    "preview": "#! /bin/bash\n\n# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]\n\nall_c_files=`ls *.c`\nexclude_files=\"\"\n\nis_exclude_file() "
  },
  {
    "path": "codes/CProgramming/ch05_选择语句/date.c",
    "chars": 973,
    "preview": "/* Print a date in legal form */\n\n/* 如输入7/19/14,输出Dated this 19th day of July, 2014. */\n\n#include <stdio.h>\n\nint main()\n"
  },
  {
    "path": "codes/CProgramming/ch05_选择语句/ex_01.c",
    "chars": 465,
    "preview": "/*\n * 下列代码段对关系运算符和判等运算符进行了说明。假设i、j和k都是 int 型变量,请列出每道题中\n * 的输出结果。\n */\n\n#include <stdio.h>\n\nint main()\n{\n\tint i, j, k;\n\n\t/"
  },
  {
    "path": "codes/CProgramming/ch05_选择语句/ex_02.c",
    "chars": 432,
    "preview": "/*\n * 下列代码段对逻辑运算符进行了说明。假设i、j和k都是 int 型变量,请列出每道题中的输出结果。\n */\n\n#include <stdio.h>\n\nint main()\n{\n\tint i, j, k;\n\n\t// (a) 1\n\t{"
  },
  {
    "path": "codes/CProgramming/ch05_选择语句/ex_03.c",
    "chars": 593,
    "preview": "/*\n * 下列代码对逻辑表达式的短路行为进行了说明。假设i、j和k都是 int 型变量,请列出每道题中的\n * 输出结果。\n */\n\n#include <stdio.h>\n\nint main()\n{\n\tint i, j, k;\n\n\t// "
  },
  {
    "path": "codes/CProgramming/ch05_选择语句/ex_04.c",
    "chars": 253,
    "preview": "/*\n * 编写一个单独的表达式,要求这个表达式的值根据i是否小于、等于或大于j而分别为-1、0或+1。\n */ \n\n#include <stdio.h>\n\nint main()\n{\n\tint i, j, res;\n\n\tj = 10;\n\n\t"
  },
  {
    "path": "codes/CProgramming/ch05_选择语句/ex_05.c",
    "chars": 477,
    "preview": "/*\n * 编写一个程序用来确定一个数的位数:\n *\n * Enter a number: 374\n * The number 374 has 3 digits\n *\n * 假设输入的数最多不超过四位。提示:利用 if 语句进行数的判定。例"
  },
  {
    "path": "codes/CProgramming/ch05_选择语句/ex_06.c",
    "chars": 405,
    "preview": "/*\n * 编写一个程序,要求用户输入24小时制的时间,然后显示12小时制的格式:\n *\n * Enter a 24-hour time: 21:11\n * Equivalent 12-hour time: 9:11 PM\n *\n * 注意"
  },
  {
    "path": "codes/CProgramming/ch05_选择语句/ex_07.c",
    "chars": 1161,
    "preview": "/*\n * 同时采用下列两种变化对程序 borker.c 进行修改。\n *\n * (a)不再直接用交易额,而是要求用户输入股票的数量和每股的价格。\n * (b)增加语句用来计算经纪人竞争对手的佣金(少于2000股时佣金为每股33美元+3美分"
  },
  {
    "path": "codes/CProgramming/ch05_选择语句/ex_08.c",
    "chars": 840,
    "preview": "/*\n * 下面是蒲福风力的简单版本。蒲福风力等级是用于测量风力的。\n *\n *     速率(=海里/小时)    描述\n *     小于1                 Calm(无风)\n *     1~3            "
  },
  {
    "path": "codes/CProgramming/ch05_选择语句/ex_09.c",
    "chars": 995,
    "preview": "/*\n * 在美国的某个州,未婚居民需要负担下列所得税:\n *\n *     收入                   税金\n *     未超过750美元          收入的1%\n *     750~2250美元         "
  },
  {
    "path": "codes/CProgramming/ch05_选择语句/ex_10.c",
    "chars": 867,
    "preview": "/*\n * 修改4.1节的程序 upc.c ,使其可以检测 UPC 的有效性。在用户输入 UPC 后,程序将显示 VALID 或 NOT\n * VALID 。\n */\n\n/* \n * Valid entry: 0 13800 15173 5"
  },
  {
    "path": "codes/CProgramming/ch05_选择语句/ex_11.c",
    "chars": 282,
    "preview": "/*\n * 下列 if 语句在C语言中是否合法?\n *\n * if (n >= 1 <= 10)\n *     printf(\"n is between 1 and 10\\n\");\n *\n * 如果合法,那么当n等于0时语句如何执行?\n *"
  },
  {
    "path": "codes/CProgramming/ch05_选择语句/ex_12.c",
    "chars": 280,
    "preview": "/*\n * 下列 if 语句在C语言中是否合法?\n * if (n == 1 - 10)\n *     printf(\"n is between 1 and 10\\n\");\n *\n * 如果合法,那么当n等于5时语句如何执行?\n */\n\n/"
  },
  {
    "path": "codes/CProgramming/ch05_选择语句/ex_13.c",
    "chars": 265,
    "preview": "/*\n * 如果i的值为17,那么下列语句显示的结果是什么?如果i的值为-17,那么下列语句显示的结果又是\n * 什么?\n *\n * printf(\"%d\\n\", i >= 0 ? i : -i);\n */\n\n/*\n * 都是17\n */\n"
  },
  {
    "path": "codes/CProgramming/ch05_选择语句/ex_14.c",
    "chars": 776,
    "preview": "/*\n * 利用 switch 语句编写一个程序,把数字显示的成绩转化为字母显示的等级:\n *\n * Enter numerical grade: 84\n * Letter grade: B\n *\n * 使用下面这套等级评定规则:A=90~"
  },
  {
    "path": "codes/CProgramming/ch05_选择语句/ex_15.c",
    "chars": 1522,
    "preview": "/*\n * 编写一个程序,要求用户输入一个两位的数,然后显示这个数的英文单词:\n *\n * Enter a two-digit number: 45\n * You entered the number forty-five\n *\n * 提示"
  },
  {
    "path": "codes/CProgramming/ch05_选择语句/ex_16.c",
    "chars": 230,
    "preview": "/*\n * 请写出下面程序段的输出结果?(假设i是整型变量)\n */\n\n/*\n * onetwo\n */\n\n#include <stdio.h>\n\nint main()\n{\n\tint i;\n\n\ti = 1;\n\tswitch (i % 3) "
  },
  {
    "path": "codes/CProgramming/ch06_循环/build.sh",
    "chars": 640,
    "preview": "#! /bin/bash\n\n# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]\n\nall_c_files=`ls *.c`\nexclude_files=\"\"\n\nis_exclude_file() "
  },
  {
    "path": "codes/CProgramming/ch06_循环/checking.c",
    "chars": 778,
    "preview": "/* Balances a checkbook */\n\n#include <stdio.h>\n\nint main()\n{\n\tint cmd;\n\tfloat balance = 0.0f, credit, debit;\n\n\tprintf(\"*"
  },
  {
    "path": "codes/CProgramming/ch06_循环/ex_01.c",
    "chars": 468,
    "preview": "/*\n * 编写程序,要求找到用户输入的一串数中的最大数。程序需要提示用户一个一个输入数。当用户输入\n * 0或负数时,程序必须显示输入的最大非负数:\n *\n * Enter a number: 60\n * Enter a number: "
  },
  {
    "path": "codes/CProgramming/ch06_循环/ex_02.c",
    "chars": 468,
    "preview": "/*\n * 编写程序,要求用户输入两个整数,然后计算并显示这两个整数的最大公约数(GCD):\n * \n * Enter two integers: 12 28\n * Greatest common divisor: 4\n *\n * 提示:求"
  },
  {
    "path": "codes/CProgramming/ch06_循环/ex_03.c",
    "chars": 450,
    "preview": "/*\n * 编写程序,要求用户输入一个分数,然后将其约分为最简分式:\n *\n * Enter a fraction: 6/12\n * In lowest terms: 1/2\n *\n * 提示:为了把分数约分为最简分式,首先计算分子和分母的"
  },
  {
    "path": "codes/CProgramming/ch06_循环/ex_04.c",
    "chars": 917,
    "preview": "/*\n * 在5.2节的 broker.c 程序中添加循环以使用户可以输入多比交易,并且程序可以计算每次的佣金。程\n * 序在用户输入的交易额为0时终止。\n *\n * Enter value of trade: 30000\n * Commi"
  },
  {
    "path": "codes/CProgramming/ch06_循环/ex_05.c",
    "chars": 280,
    "preview": "/*\n * 第4章中的练习3要求编写程序可以显示两位数字的反向。设计一个程序可以实现一位、两位、三位或者多位数的反向。提示:使用 do 循环重复除以10,直到值达到0为止。\n */\n\n#include <stdio.h>\n\nint main"
  },
  {
    "path": "codes/CProgramming/ch06_循环/ex_06.c",
    "chars": 276,
    "preview": "/*\n * 编写程序,要求提示用户输入一个数n,然后显示出1~n的所有偶数平方。例如,如果用户输入10,\n * 那么程序员应该显示出下列内容:\n *\n * 4\n * 16\n * 36\n * 64\n * 100\n */\n\n#include <"
  },
  {
    "path": "codes/CProgramming/ch06_循环/ex_07.c",
    "chars": 401,
    "preview": "/*\n * 重新安排程序 square3.c 以便 for 循环对变量i进行初始化,对变量i进行判定,并且对变量i进行\n * 自增操作。不需要重写程序,特别是不要使用任何乘法。\n */\n\n#include <stdio.h>\n\nint ma"
  },
  {
    "path": "codes/CProgramming/ch06_循环/ex_08.c",
    "chars": 862,
    "preview": "/*\n * 编写程序,要求显示出单月的日历。用户说明这个月的天数和本月起始日是星期几。\n *\n * Enter number of days in month: 31\n * Enter starting day of the week(1="
  },
  {
    "path": "codes/CProgramming/ch06_循环/ex_09.c",
    "chars": 393,
    "preview": "/*\n * 下面这条 for 语句的输出是什么?\n *\n * for (i = 5, j = i - 1; i > 0, j > 0; --i, j = i - 1)\n * \tprintf(\"%d \", i);\n */\n\n/*\n * r1:"
  },
  {
    "path": "codes/CProgramming/ch06_循环/ex_10.md",
    "chars": 189,
    "preview": "下列哪条语句和其他两条语句不等价(假设循环体都是一样的)?\n\n(a) for (i = 0; i < 10; i++) ...\n\n(b) for (i = 0; i < 10; ++i) ...\n\n(c) for (i = 0; i++ <"
  },
  {
    "path": "codes/CProgramming/ch06_循环/ex_11.md",
    "chars": 177,
    "preview": "下列哪条语句和其他两条语句不等价(假设循环体都是一样的)?\n\n(a) while (i < 10) {...}\n\n(b) for (; i < 10;) {...}\n\n(c) do {...} while (i < 10);\n\n---\n\nc"
  },
  {
    "path": "codes/CProgramming/ch06_循环/ex_12.c",
    "chars": 221,
    "preview": "/*\n * 显示如何用等价的 goto 语句替换 continue 语句。\n */\n\n#include <stdio.h>\n\nint main()\n{\n\t/* 输出10以内的奇数 */\n\tint i;\n\n\tfor (i = 0; i < 1"
  },
  {
    "path": "codes/CProgramming/ch06_循环/ex_13.c",
    "chars": 346,
    "preview": "/*\n * 下面的程序段产生的输出是什么?\n *\n * sum = 0;\n * for (i = 0; i < 10; ++i) {\n * \tif (i % 2) continue;\n * \tsum += i;\n * }\n * printf"
  },
  {
    "path": "codes/CProgramming/ch06_循环/ex_14.c",
    "chars": 482,
    "preview": "/*\n * 下面的“素数判定”循环作为示例出现在6.4节中:\n *\n * for (d = 2; d < n; d++)\n * \tif (n % d == 0) break;\n *\n * 这个循环不是很有效。用n除以2~n-1所有数的方法来"
  },
  {
    "path": "codes/CProgramming/ch06_循环/ex_15.c",
    "chars": 173,
    "preview": "/*\n * 重写下面的循环,从而使其循环体为空。\n *\n * for (n = 0; m > 0; n++)\n * \tm /= 2;\n */\n\n#include <stdio.h>\n\nint main()\n{\n\tint n, m;\n\n\tm "
  },
  {
    "path": "codes/CProgramming/ch06_循环/ex_16.md",
    "chars": 154,
    "preview": "找出下面程序段的错误并且修正它。\n\n```c\nif (n % 2 == 0);\n\tprintf(\"n is even\\n\");\n```\n\n---\n\nif 的条件判断后不应该是一个分号。正确的应该是:\n\n```c\nif (n % 2 == 0"
  },
  {
    "path": "codes/CProgramming/ch06_循环/example_goto.c",
    "chars": 309,
    "preview": "/*\n * goto 语句(p71)\n */\n\n#include <stdio.h>\n\n/* 输入一个值,判断它是否是质数 */\nint main()\n{\n\tint n;\n\tint d;\n\n\tprintf(\"Enter a number: "
  },
  {
    "path": "codes/CProgramming/ch06_循环/numdigit.c",
    "chars": 281,
    "preview": "/* Calculates the number of digits in an integer */\n\n#include <stdio.h>\n\nint main()\n{\n\tint digits = 0, n;\n\n\tprintf(\"Ente"
  },
  {
    "path": "codes/CProgramming/ch06_循环/square.c",
    "chars": 312,
    "preview": "/* Prints a table of squares using a while statement */\n\n#include <stdio.h>\n\nint main(void)\n{\n\tint i, n;\n\n\tprintf(\"This "
  },
  {
    "path": "codes/CProgramming/ch06_循环/square2.c",
    "chars": 294,
    "preview": "/* Prints a table of squares using a for statement */\n\n#include <stdio.h>\n\nint main()\n{\n\tint i, n;\n\n\tprintf(\"This progra"
  },
  {
    "path": "codes/CProgramming/ch06_循环/square3.c",
    "chars": 363,
    "preview": "/* Prints a table of squares using an odd method */\n\n#include <stdio.h>\n\nint main()\n{\n\tint i, n, odd, square;\n\n\tprintf(\""
  },
  {
    "path": "codes/CProgramming/ch06_循环/sum.c",
    "chars": 303,
    "preview": "/* Sums a serias of numbers */\n\n#include <stdio.h>\n\nint main()\n{\n\tint n, sum = 0;\n\n\tprintf(\"This program sums a serias o"
  },
  {
    "path": "codes/CProgramming/ch07_基本类型/build.sh",
    "chars": 640,
    "preview": "#! /bin/bash\n\n# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]\n\nall_c_files=`ls *.c`\nexclude_files=\"\"\n\nis_exclude_file() "
  },
  {
    "path": "codes/CProgramming/ch07_基本类型/ex_01.c",
    "chars": 213,
    "preview": "/*\n * 请给出下列整型常量的十进制数值。\n *\n * (a) 077\n * (b) 0x77\n * (c) 0XABC\n */\n\n#include <stdio.h>\n\nint main()\n{\n\tprintf(\"%d\\n\", 077)"
  },
  {
    "path": "codes/CProgramming/ch07_基本类型/ex_02.c",
    "chars": 852,
    "preview": "/*\n * 如果i*i超出了 int 型的最大取值,那么6.3节的程序 square2.c 将失败(通常会显示奇怪的答案)。\n * 运行程序,并且确定导致失败的n的最小值。尝试把变量i的类型改成 short int 类型,并且再次\n * 运"
  },
  {
    "path": "codes/CProgramming/ch07_基本类型/ex_03.c",
    "chars": 377,
    "preview": "/*\n * 下列哪些在C语言中不是合法的数?区分每一个合法的数是整数还是浮点数。\n *\n * (a) 010E2\n * (b) 32.1E+5\n * (c) 0790\n * (d) 100_000\n * (e) 3.978e-2\n */\n\n"
  },
  {
    "path": "codes/CProgramming/ch07_基本类型/ex_04.c",
    "chars": 268,
    "preview": "/*\n * 下列哪些在C语言中不是合法的类型?\n *\n * (a) short unsigned int\n * (b) short float\n * (c) long double\n * (d) unsigned long\n */\n\nint"
  },
  {
    "path": "codes/CProgramming/ch07_基本类型/ex_05.c",
    "chars": 321,
    "preview": "/*\n * 修改程序 sum2.c 以便可以进行一串 double 型值的求和计算。\n */\n\n#include <stdio.h>\n\nint main()\n{\n\tdouble n, sum = 0;\n\n\tprintf(\"This prog"
  },
  {
    "path": "codes/CProgramming/ch07_基本类型/ex_06.c",
    "chars": 252,
    "preview": "/*\n * 如果变量c是char类型,那么下列哪条语句是非法的?\n *\n * (a) i += c;\n * (b) c = 2 * c - 1;\n * (c) putchar(c);\n * (d) printf(c);\n */\n\n#incl"
  },
  {
    "path": "codes/CProgramming/ch07_基本类型/ex_07.md",
    "chars": 90,
    "preview": "下列哪条在书写数65上不是合法的方式?(假设字符集是ASCII)\n\n(a) 'A'\n\n(b) 0b1000001\n\n(c) 0101\n\n(d) 0x41\n\n---\n\n(b) 不是\n"
  },
  {
    "path": "codes/CProgramming/ch07_基本类型/ex_08.c",
    "chars": 551,
    "preview": "/*\n * 修改6.3节的程序 square2.c 以便它在每24次平方后暂停并且显示下列信息:\n * Press Enter to continue...\n */\n\n/* Prints a table of squares using a"
  },
  {
    "path": "codes/CProgramming/ch07_基本类型/ex_09.c",
    "chars": 959,
    "preview": "/*\n * 编写程序可以把字母格式的电话号码翻译成数值格式:\n *\n * Enter phone number: CALLATT\n * 2255288\n *\n * (万一没有电话在身边,后面有字母在键盘上的对应关系:2=ABC, 3=DEF"
  },
  {
    "path": "codes/CProgramming/ch07_基本类型/ex_10.c",
    "chars": 1026,
    "preview": "/*\n * 在十字拼字游戏中,玩家利用小卡片组成单词,每个卡片包含字母和面值。面值根据字母的不同而\n * 不同,也就是说面值是基于字母变化的。(面值有:1-AEILNORSTU, 2-DG, 3-BCMP, 4-FHVWY, 5-K\n * "
  },
  {
    "path": "codes/CProgramming/ch07_基本类型/ex_11.c",
    "chars": 710,
    "preview": "/*\n * 飞机票有冗长的标识数字,例如47715497443。为了有效,最后一位数字必须与其他位的数字为整体\n * 除以7后的余数相匹配。(例如,47715497443除以7的余数为3。)编写程序检查机票号是否有效:\n *\n * Ente"
  },
  {
    "path": "codes/CProgramming/ch07_基本类型/ex_12.c",
    "chars": 482,
    "preview": "/*\n * 编写程序显示 sizeof(int) 、 sizeof(short int) 、 sizeof(long int) 、 sizeof(float) 、\n * sizeof(double) 和 sizeof(long double"
  },
  {
    "path": "codes/CProgramming/ch07_基本类型/ex_13.md",
    "chars": 60,
    "preview": "假设变量i和变量j都是 int 类型,那么表达式 i / j + 'a' 是什么类型?\n\n---\n\n是 int 类型。\n"
  },
  {
    "path": "codes/CProgramming/ch07_基本类型/ex_15.md",
    "chars": 83,
    "preview": "假设变量i是 int 类型,变量f是 float 类型,并且变量d是 double 类型,那么表达式 `i * f / d` 是什么类型?\n\n---\n\ndouble\n"
  },
  {
    "path": "codes/CProgramming/ch07_基本类型/ex_16.md",
    "chars": 146,
    "preview": "假设变量i是 int 类型,变量f是 float 类型,并且变量d是 double 类型,请解释在执行下列语句时发生了什么转换?\n\n```c\nd = i + f;\n```\n\n---\n\ni + f,将 int 转换成 float,然后将这个表"
  },
  {
    "path": "codes/CProgramming/ch07_基本类型/ex_17.c",
    "chars": 646,
    "preview": "/*\n * 假设程序包含下列声明:\n *\n * char c = '\\1';\n * short int s = 2;\n * int i = -3;\n * long int m = 5;\n * float f = 6.5;\n * double"
  },
  {
    "path": "codes/CProgramming/ch07_基本类型/ex_18.md",
    "chars": 136,
    "preview": "下列语句是否始终可以正确地计算出f的小数部分(假设f和 frac_part 都是 float 型的变量)?\n\n```c\nfrac_part = f - (int)f;\n```\n\n如果不是,那么出了什么问题?\n\n---\n\n可能不会正确计算,当"
  },
  {
    "path": "codes/CProgramming/ch07_基本类型/ex_19.c",
    "chars": 383,
    "preview": "/*\n * 使用 typedef 产生名为 Int8 、 Int16 和 Int32 的类型。定义这些类型以便它们可以在你的机器上分\n * 别表示8位、16位和32位的整数。\n */\n\n/*\n * PS,我的机器架构是:x86_64\n */"
  },
  {
    "path": "codes/CProgramming/ch07_基本类型/length.c",
    "chars": 350,
    "preview": "/* Determins the length of a message */\n\n#include <stdio.h>\n\n// 把输入行的剩余字符读完,返回读入的字符数,不包括\\n\nint skips_rest_line()\n{\n\tint "
  },
  {
    "path": "codes/CProgramming/ch07_基本类型/mytoupper.c",
    "chars": 222,
    "preview": "/* 字符小写转大写 */\n\n#include <stdio.h>\n\nchar my_toupper(char c)\n{\n\tif (c >= 'a' && c <= 'z')\n\t{\n\t\tc = c - 'a' + 'A';\n\t}\n\n\tret"
  },
  {
    "path": "codes/CProgramming/ch07_基本类型/scanf_char.c",
    "chars": 201,
    "preview": "/* 测试读入字符,且不要读入前面的空格 */\n\n#include <stdio.h>\n\nint main()\n{\n\tchar a, b;\n\n\tscanf(\"%c %c\", &a, &b); // a和b之间可以输入任意个空格\n\t// sc"
  },
  {
    "path": "codes/CProgramming/ch07_基本类型/sum2.c",
    "chars": 363,
    "preview": "/*\n * 数列求和(改进版)(p81)\n */\n\n/* Sums a series of numbers (using long int variabels) */\n\n#include <stdio.h>\n\nint main()\n{\n\tl"
  },
  {
    "path": "codes/CProgramming/ch07_基本类型/typedef_sizeof.c",
    "chars": 153,
    "preview": "/* 测试typedef和sizeof */\n\n#include <stdio.h>\n\ntypedef char Name[32];\n\nint main()\n{\n\tName name;\n\n\tprintf(\"sizeof name: %lu\\"
  },
  {
    "path": "codes/CProgramming/ch08_数组/build.sh",
    "chars": 649,
    "preview": "#! /bin/bash\n\n# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]\n\nall_c_files=`ls *.c`\nexclude_files=\"\"\n\nis_exclude_file() "
  },
  {
    "path": "codes/CProgramming/ch08_数组/deal.c",
    "chars": 840,
    "preview": "/* Deals a random hand of cards. */\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <time.h>\n#include <string.h>\n\n#defi"
  },
  {
    "path": "codes/CProgramming/ch08_数组/ex_01.c",
    "chars": 620,
    "preview": "/*\n * 修改程序 repdigit.c ,要求修改后的程序可以显示出重复的数字(如果有的话):\n *\n * Enter a number: 939577\n * Repeated digit(s): 7 9\n */\n\n/*\n * 程序:检"
  },
  {
    "path": "codes/CProgramming/ch08_数组/ex_02.c",
    "chars": 744,
    "preview": "/*\n * 修改程序 repdigit.c ,要求修改后的程序可以显示出一张列表,表内显示出每种数字在数中出现的\n * 次数:\n *\n * Enter a number: 41271092\n * Digit:\t\t0 1 2 3 4 5 6 "
  },
  {
    "path": "codes/CProgramming/ch08_数组/ex_03.c",
    "chars": 786,
    "preview": "/*\n * 修改程序 repdigit.c,要求修改后的程序可以让用户录入多于一个的数进行重复数字的判断。当用\n * 户录入的数小于或等于0时,程序终止。\n */\n\n/*\n * 程序:检查数中重复出现的数字(p101)\n *\n * Ente"
  },
  {
    "path": "codes/CProgramming/ch08_数组/ex_04.md",
    "chars": 152,
    "preview": "已经讨论过利用表达式`sizeof(a) / sizeof(a[0])`进行数组元素个数的计算。表达式`sizeof(a)/sizeof(t)`也可以完成同样的工作,其中t表示数组a中元素的类型,但是这种方法被认为是一种较差的技术。这是为什"
  },
  {
    "path": "codes/CProgramming/ch08_数组/ex_05.c",
    "chars": 565,
    "preview": "/*\n * 修改程序 reverse.c ,利用表达式 sizeof(a) / sizeof(a[0]) (或者这个值的宏)来计算数组\n * 的长度。\n */\n\n/*\n * 程序:数列反向(p100)\n *\n * Enter 10 numb"
  },
  {
    "path": "codes/CProgramming/ch08_数组/ex_06.c",
    "chars": 888,
    "preview": "/*\n * 修改程序 interest.c ,使得修改后的程序可以每月整合一次利息,而不再是每年整合一次利息。程\n * 序的输出格式不变;余额应该始终按每年一次的间隔显示。\n */\n\n/* Print a table of compound"
  },
  {
    "path": "codes/CProgramming/ch08_数组/ex_07.c",
    "chars": 1098,
    "preview": "/*\n * 在线运动的名人之一是一个称为 BIFF 的家伙,他在编写消息上有独一无二的方法。下面是一条典\n * 型的 BIFF 公告:\n *\n * H3Y DUD3, C 15 R1LLY C00L!!!!!!!!!!\n *\n * 编写一个"
  },
  {
    "path": "codes/CProgramming/ch08_数组/ex_08.md",
    "chars": 74,
    "preview": "“问与答”小节介绍了使用字母作为数组下标的方法。请描述一下如何使用数字(字符格式的)作为数组的下标。\n\n---\n\n用字符格式的数字减去`'0'`。\n"
  },
  {
    "path": "codes/CProgramming/ch08_数组/ex_09.c",
    "chars": 536,
    "preview": "/*\n * 计算器、手表和其他电子设备经常依靠七段显示器进行数值的输出。为了组成数字,这类设备需要“打\n * 开”7个显示段中的某些部分,同时还需要“关闭”七个显示段中的其他部分:\n *\n * 。。。\n *\n *   0\n *   -\n *"
  },
  {
    "path": "codes/CProgramming/ch08_数组/ex_10.c",
    "chars": 568,
    "preview": "/*\n * 利用8.2节的简洁描述对数组 segments (练习9中)的初始化式尽可能地进行化简。\n */\n\n/*\n * 计算器、手表和其他电子设备经常依靠七段显示器进行数值的输出。为了组成数字,这类设备需要“打\n * 开”7个显示段中的"
  },
  {
    "path": "codes/CProgramming/ch08_数组/ex_11.c",
    "chars": 795,
    "preview": "/*\n * 编写程序,要求此程序可以用来读取一个 5*5 的整数数组,然后显示出每行的求和结果和每列的\n * 求和结果。\n *\n * Enter row 1: 8 3 9 0 10\n * Enter row 2: 3 5 17 1 1\n *"
  },
  {
    "path": "codes/CProgramming/ch08_数组/ex_12.c",
    "chars": 1310,
    "preview": "/*\n * 修改练习11,要求修改后的程序可以提示每个学生5门测验的成绩,一共有5个学生,然后计算每个学\n * 生的5门测验的总分和平均分,还要列出每门测验的平均分、高分和低分。\n */\n\n/*\n * 编写程序,要求此程序可以用来读取一个 "
  },
  {
    "path": "codes/CProgramming/ch08_数组/ex_13.c",
    "chars": 978,
    "preview": "/*\n * 描述见书本。\n */\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <time.h>\n\nint main()\n{\n\tchar matrix[10][10];\n\tint i, j"
  },
  {
    "path": "codes/CProgramming/ch08_数组/interest.c",
    "chars": 740,
    "preview": "/* Print a table of compound interest */\n\n#include <stdio.h>\n\n#define ARRAY_ITEM_COUNT(a) ((int)(sizeof(a) / sizeof(a[0]"
  },
  {
    "path": "codes/CProgramming/ch08_数组/repdigit.c",
    "chars": 519,
    "preview": "/*\n * 程序:检查数中重复出现的数字(p101)\n *\n * Enter a number: 28212\n * Repeated digit\n */\n\n/* Checks numbers for repeated digits */\n\n"
  },
  {
    "path": "codes/CProgramming/ch08_数组/reverse.c",
    "chars": 422,
    "preview": "/*\n * 程序:数列反向(p100)\n *\n * Enter 10 numbers: 34 82 49 102 7 94 23 11 50 31\n * In reverse order: 31 50 11 23 94 7 102 49 8"
  },
  {
    "path": "codes/CProgramming/ch09_函数/average.c",
    "chars": 425,
    "preview": "/* Computes pairwise average of three numbers. */\n\n#include <stdio.h>\n\ndouble average(double a, double b)\n{\n\treturn (a +"
  },
  {
    "path": "codes/CProgramming/ch09_函数/build.sh",
    "chars": 649,
    "preview": "#! /bin/bash\n\n# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]\n\nall_c_files=`ls *.c`\nexclude_files=\"\"\n\nis_exclude_file() "
  },
  {
    "path": "codes/CProgramming/ch09_函数/countdown.c",
    "chars": 203,
    "preview": "/* Prints a countdown */\n\n#include <stdio.h>\n\nvoid print_count(int n)\n{\n\tprintf(\"T minus %2d and counting\\n\", n);\n}\n\nint"
  },
  {
    "path": "codes/CProgramming/ch09_函数/ex_01.c",
    "chars": 470,
    "preview": "/*\n * 下面计算三角形面积的函数有两处错误。找出这些错误,并且说明修改它们的方法。(提示:公式没有\n * 错误)\n *\n * float triangle_area(float base, height)\n * float produc"
  },
  {
    "path": "codes/CProgramming/ch09_函数/ex_02.c",
    "chars": 310,
    "preview": "/*\n * 编写函数check(x, y, n):如果x和y都落在0到n-1的闭区间内,那么使得函数check返回1。否则,\n * 函数应该返回0。假设x、y和n都是 int  类型。\n */\n\n#include <stdio.h>\n\nin"
  },
  {
    "path": "codes/CProgramming/ch09_函数/ex_03.c",
    "chars": 588,
    "preview": "/*\n * 编写函数gcd(m,n)用来计算整数m和n的最大公约数。(第6章的练习2描述了计算最大公约数的Euclid算法)\n */\n\n/*\n * 编写程序,要求用户输入两个整数,然后计算并显示这两个整数的最大公约数(GCD):\n * \n "
  },
  {
    "path": "codes/CProgramming/ch09_函数/ex_04.c",
    "chars": 752,
    "preview": "/*\n * 编写函数 day_of_year(month, day, year) , 使得函数返回某 month 某 day 是 year 这一年中的\n * 第几天(1和366之间的整数)。\n */\n\n#include <stdio.h>\n"
  },
  {
    "path": "codes/CProgramming/ch09_函数/ex_05.c",
    "chars": 342,
    "preview": "/*\n * 编写函数 num_digits(n) , 使得函数返回正整数n中数字的个数。提示:为了确定n中的数字的个数,\n * 把这个数反复除以10.当n达到0时,除法的次数表明了n最初拥有的数字的个数。\n */\n\n#include <st"
  },
  {
    "path": "codes/CProgramming/ch09_函数/ex_06.c",
    "chars": 435,
    "preview": "/*\n * 编写函数 digit(n, k) , 使得函数返回正整数n中第k个数字(从右边算起)。例如,digit(829, 1)\n * 返回9, digit(829, 2) 返回2,而 digit(829, 3) 则返回8。如果k大于n所"
  },
  {
    "path": "codes/CProgramming/ch09_函数/ex_07.c",
    "chars": 355,
    "preview": "/*\n * 假设函数f有下列定义:\n *\n * int f(int a, int b) { ... }\n *\n * 那么下列哪条语句是合法的?(假设i的类型为 int 而x的类型为 float 。)\n */\n\nint f(int a, in"
  },
  {
    "path": "codes/CProgramming/ch09_函数/ex_08.md",
    "chars": 130,
    "preview": "对于返回为空且有一个 float 型形式参数的函数,下列哪个函数原型是有效的?\n\n(a) void f(float x);\n\n(b) void f(float);\n\n(c) void f(x);\n\n(d) f(float x);\n\n---\n"
  },
  {
    "path": "codes/CProgramming/ch09_函数/ex_09.c",
    "chars": 259,
    "preview": "/*\n * 下列程序的输出是什么?\n */\n\n/*\n * x = 1, y = 2\n */\n\n#include <stdio.h>\n\nvoid swap(int a, int b);\n\nint main()\n{\n\tint x = 1, y "
  },
  {
    "path": "codes/CProgramming/ch09_函数/ex_10.c",
    "chars": 1125,
    "preview": "/*\n * 编写函数,使得函数返回下列值。(假设a和n是形式参数,其中a是有 int 型值的数组,而n则是数组\n * 的长度。)\n *\n * (a) 数组a中的最大元素\n * (b) 数组a中所有元素的平均值\n * (c) 数组a中正数元素"
  },
  {
    "path": "codes/CProgramming/ch09_函数/ex_11.md",
    "chars": 403,
    "preview": "如果数组a的所有元素值都为0,那么假设下列函数返回 TRUE ;如果数组的所有元素都是非零的,则函数返回 FALSE 。可惜的是,此函数有错误。请找出错误并说明修改它的方法。\n\n```c\nBool has_zero(int a[], int"
  },
  {
    "path": "codes/CProgramming/ch09_函数/ex_12.c",
    "chars": 657,
    "preview": "/*\n * 下面的(不要弄混)函数用来找到三个数的中间数。重新编写函数,使得它只有一条 return 语句。\n *\n * float median(float x, float y, float z)\n * {\n * \tif (x <= y"
  },
  {
    "path": "codes/CProgramming/ch09_函数/ex_13.c",
    "chars": 183,
    "preview": "/*\n * 请采用精简 power 函数的方法,来简化 fact 函数。\n */\n\n#include <stdio.h>\n\nint fact(int n)\n{\n\treturn n <= 1 ? 1 : n * fact(n - 1);\n}\n"
  },
  {
    "path": "codes/CProgramming/ch09_函数/ex_14.c",
    "chars": 217,
    "preview": "/*\n * 请重新编写 fact 函数,使得编写后的函数不再递归。\n */\n\n#include <stdio.h>\n\nint fact(int n)\n{\n\tint res = 1, i;\n\n\tfor (i = 2; i <= n; i++)"
  },
  {
    "path": "codes/CProgramming/ch09_函数/ex_15.c",
    "chars": 344,
    "preview": "/*\n * 编写递归版本的 gcd 函数(参加练习3)。有一种用于计算 gcd(m, n) 的策略;如果 n 为0,那么返回m;\n * 否则,递归地调用 gcd 函数,把n作为第一个实际参数进行传递,而把 m % n 作为第二个实际参数进行"
  },
  {
    "path": "codes/CProgramming/ch09_函数/ex_16.c",
    "chars": 381,
    "preview": "/*\n * 思考下面这个“神秘的”函数:\n * void pb(int n)\n * {\n * \tif (n != 0) {\n * \t\tpb(n / 2);\n * \t\tputchar('O' + n % 2);\n * \t}\n * }\n *\n "
  },
  {
    "path": "codes/CProgramming/ch09_函数/ex_17.c",
    "chars": 812,
    "preview": "/*\n * 编写程序,要求用户录入一串整数(把这串整数存储在数组中),然后通过调用 selection_sort 函数\n * 来排序这些整数。在给定n个元素的数组后, selection_sort 函数必须做下列工作:\n * (a) 搜索数"
  },
  {
    "path": "codes/CProgramming/ch09_函数/prime.c",
    "chars": 407,
    "preview": "/* Tests whether a number is prime */\n\n#include <stdio.h>\n\nint is_prime(int n)\n{\n\tint divisor;\n\n\tif (n <= 1) return 0;\n\n"
  },
  {
    "path": "codes/CProgramming/ch09_函数/pun2.c",
    "chars": 165,
    "preview": "/* Prints a bad pun */\n\n#include <stdio.h>\n\nvoid print_pun(void)\n{\n\tprintf(\"To C or not to C, that is the question.\\n\");"
  },
  {
    "path": "codes/CProgramming/ch09_函数/qsort.c",
    "chars": 1002,
    "preview": "/* Sorts an array of integers using Quicksort algorithm */\n\n#include <stdio.h>\n\n#define LEN 10\n\nvoid quicksort(int a[], "
  },
  {
    "path": "codes/CProgramming/ch10_程序结构/build.sh",
    "chars": 649,
    "preview": "#! /bin/bash\n\n# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]\n\nall_c_files=`ls *.c`\nexclude_files=\"\"\n\nis_exclude_file() "
  },
  {
    "path": "codes/CProgramming/ch10_程序结构/ex_01.c",
    "chars": 1279,
    "preview": "/*\n * 修改栈示例使它存储字符而不是整数。接下来,增加 main 函数,用来要求用户输入一串圆括号或大\n * 括号,然后指出它们是否正确嵌套:\n *\n * Enter parenteses and/or braces: {{}{}}\n "
  },
  {
    "path": "codes/CProgramming/ch10_程序结构/ex_02.md",
    "chars": 279,
    "preview": "下面的程序框架只显示了函数定义和变量声明。\n\n```c\nint a;\n\nvoid f(int b) \n{\n\tint c;\n}\n\nvoid g(void)\n{\n\tint d;\n\t{\n\t\tint b;\n\t}\n}\n\nmain()\n{\n\tint f"
  },
  {
    "path": "codes/CProgramming/ch10_程序结构/ex_03.c",
    "chars": 4246,
    "preview": "/*\n * 修改poker.c程序,把数组 num_in_rank 和数组 num_in_suit 移入 main 函数。 main 函数将把这\n * 两个数组作为实际参数传递给 read_cards 函数和 analyze_hand 函数"
  },
  {
    "path": "codes/CProgramming/ch10_程序结构/ex_04.c",
    "chars": 4790,
    "preview": "/*\n * 把数组 num_in_rank 、数组 num_in_suit 和数组 card_exists 从 poker.c 程序中去掉。程序改用\n * 5*2d的数组来代替存储牌。\n */\n\n/*\n * Classifies a pok"
  },
  {
    "path": "codes/CProgramming/ch10_程序结构/ex_05.c",
    "chars": 4958,
    "preview": "/*\n * 修改 poker.c 程序,使其识别牌的额外类别——“同花大顺”(A、K、Q、J,以及同样花色的10)。\n * 同花大顺的级别高于其他所有的类别。\n */\n\n/*\n * Classifies a poker hand\n */\n\n"
  },
  {
    "path": "codes/CProgramming/ch10_程序结构/ex_06.c",
    "chars": 5030,
    "preview": "/*\n * 修改 poker.c 程序,使其允许“小A顺”(即A、2、3、4和5)。\n */\n\n/*\n * Classifies a poker hand\n */\n\n#include <stdio.h>\n#include <stdlib.h"
  },
  {
    "path": "codes/CProgramming/ch10_程序结构/ex_07.c",
    "chars": 447,
    "preview": "/*\n * 编写下列函数:\n *\n * int *find_middle(int a[], int n);\n *\n * 当传递长度为n的数组a时,函数将返回指向数组的中间元素的指针。(如果n是偶数,选择较大下标的\n * 中间元素。例如,如果"
  },
  {
    "path": "codes/CProgramming/ch10_程序结构/guess.c",
    "chars": 1158,
    "preview": "/* Asks user to guess a hidden number */\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <time.h>\n\n#define MAX_NUMBER 1"
  },
  {
    "path": "codes/CProgramming/ch10_程序结构/poker.c",
    "chars": 3936,
    "preview": "/*\n * Classifies a poker hand\n */\n\n#include <stdio.h>\n#include <stdlib.h>\n\n#define NUM_RANKS 13\n#define NUM_SUITS 4\n#def"
  },
  {
    "path": "codes/CProgramming/ch10_程序结构/stack.c",
    "chars": 551,
    "preview": "#include <stdio.h>\n\n#define STACK_SIZE 100\n\n/* external variables */\nint contents[STACK_SIZE];\nint top = 0;\n\nvoid make_e"
  },
  {
    "path": "codes/CProgramming/ch11_指针/build.sh",
    "chars": 649,
    "preview": "#! /bin/bash\n\n# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]\n\nall_c_files=`ls *.c`\nexclude_files=\"\"\n\nis_exclude_file() "
  },
  {
    "path": "codes/CProgramming/ch11_指针/ex_01.md",
    "chars": 112,
    "preview": "如果i是变量,并且p指向i,那么下列哪个表达式是i的别名?\n\n(a) *p\n\n(b) &p\n\n(c) *&p\n\n(d) &*p\n\n(e) *i\n\n(f) &i\n\n(g) *&i\n\n(h) &*i\n\n---\n\n(a) (g)\n"
  },
  {
    "path": "codes/CProgramming/ch11_指针/ex_02.md",
    "chars": 173,
    "preview": "如果i是 int 型变量,而且p和q是指向 int 的指针,下列哪个赋值是合法的?\n\n(a) p = i;\n\n(b) *p = &i;\n\n(c) &p = q;\n\n(d) p = &p;\n\n(e) p = &p;\n\n(f) p = q;\n\n"
  },
  {
    "path": "codes/CProgramming/ch11_指针/ex_03.c",
    "chars": 646,
    "preview": "/*\n * 下列函数假设用来计算数组a中元素的和以及平均值,且数组a长度为n。 avg 和 sum 指向函数需要修改\n * 的变量。函数有几个错误,请找出这些错误并修改它们。\n *\n * void avg_sum(float a[], in"
  },
  {
    "path": "codes/CProgramming/ch11_指针/ex_04.c",
    "chars": 366,
    "preview": "/*\n * 编写下列函数:\n *\n * void swap(int *x, int *y);\n *\n * 当传递两个变量的地址时, swap 函数应该交换两者的值:\n *\n * swap(&x, &y);\n *\n * 利用此函数修改第9章中"
  },
  {
    "path": "codes/CProgramming/ch11_指针/ex_05.c",
    "chars": 651,
    "preview": "/*\n * 编写下列函数:\n *\n * void split_time(long int total_sec,\n * \t\t\t\t   int *hr, int *min, int *sec);\n *\n * total_sec 是从午夜计算的秒"
  },
  {
    "path": "codes/CProgramming/ch11_指针/ex_06.c",
    "chars": 1024,
    "preview": "/*\n * 编写下列函数:\n *\n * void find_two_largest(int a[], int n, int *largest, int *second_largest);\n *\n * 当传递长度为n的数组a时,函数将在数组a"
  },
  {
    "path": "codes/CProgramming/ch11_指针/maxmin.c",
    "chars": 568,
    "preview": "/*\n * Finds the largest and smallest elements in an array\n */\n\n#include <stdio.h>\n\n#define N 10\n\nvoid max_min(int a[], i"
  },
  {
    "path": "codes/CProgramming/ch12_指针和数组/build.sh",
    "chars": 649,
    "preview": "#! /bin/bash\n\n# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]\n\nall_c_files=`ls *.c`\nexclude_files=\"\"\n\nis_exclude_file() "
  },
  {
    "path": "codes/CProgramming/ch12_指针和数组/ex_01.c",
    "chars": 600,
    "preview": "/*\n * 假设下列声明是有效的:\n *\n * int a[] = {5, 15, 34, 54, 14, 2, 52, 72};\n * int *p = &a[1], *q = &a[5];\n *\n * (a) *(p + 3)的值是多少"
  },
  {
    "path": "codes/CProgramming/ch12_指针和数组/ex_02.md",
    "chars": 182,
    "preview": "假设 high, low 和 middle 都是具有相同类型的指针,并且 low 和 high 指向数组元素。下面的语句为什么是不合法的,如何修改它?\n\n```c\nmiddle = (low + hight) / 2;\n```\n\n---\n\n"
  },
  {
    "path": "codes/CProgramming/ch12_指针和数组/ex_03.c",
    "chars": 320,
    "preview": "/*\n * 在下列语句执行后,数组a的内容会是什么?\n */\n\n/*\n * 反转a\n */\n\n#include <stdio.h>\n\n#define N 10\n\nint main()\n{\n\tint a[N] = {1, 2, 3, 4, 5"
  },
  {
    "path": "codes/CProgramming/ch12_指针和数组/ex_04.c",
    "chars": 914,
    "preview": "/*\n * (a) 编写程序,用来读取一条消息,然后反向显示出这条消息。程序的输出格式如下:\n *\n * Enter a message: Don't get mad, get even.\n * Reversal is: .neve teg"
  },
  {
    "path": "codes/CProgramming/ch12_指针和数组/ex_05.c",
    "chars": 1277,
    "preview": "/*\n * (a) 编写程序,用来读一条消息,然后检查这条消息是否是回文(信息中从左到右的字母和从右到左\n * 的字母完全一样):\n *\n * Enter a message: He lived as a devil, eh?\n * Pal"
  },
  {
    "path": "codes/CProgramming/ch12_指针和数组/ex_06.c",
    "chars": 674,
    "preview": "/*\n * 用指针变量 top_ptr 代替整型变量 top 来重新编写栈函数 make_empty、is_empty 和\n * is_full(10.2节)。\n */\n\n#include <stdio.h>\n\n#define STACK_"
  },
  {
    "path": "codes/CProgramming/ch12_指针和数组/ex_07.md",
    "chars": 175,
    "preview": "假设a是一维数组而p是指针变量。如果刚执行了赋值操作p = a,那么由于类型不匹配,下列哪些表达式是不合法的?正确的表达式中,哪些为真(即有非零值)?\n\n(a) p == a[0]\n\n(b) p == &a[0]\n\n(c) *p == a["
  },
  {
    "path": "codes/CProgramming/ch12_指针和数组/ex_08.md",
    "chars": 38,
    "preview": "请利用数组名可以用作指针的事实简化练习4中(b)的程序。\n\n---\n\n略。\n"
  },
  {
    "path": "codes/CProgramming/ch12_指针和数组/ex_09.md",
    "chars": 38,
    "preview": "请利用数组名可以用作指针的事实简化练习5中(b)的程序。\n\n---\n\n略。\n"
  },
  {
    "path": "codes/CProgramming/ch12_指针和数组/ex_10.c",
    "chars": 430,
    "preview": "/*\n * 用指针的算术运算代替数组的下标来重新编写下列函数。(换句话说,消除变量i和所有用[]运算的\n * 地方。)改动尽可能少。\n *\n * int sum_array(int a[], int n)\n * {\n * \tint i, s"
  },
  {
    "path": "codes/CProgramming/ch12_指针和数组/ex_11.c",
    "chars": 563,
    "preview": "/*\n * 编写下列函数:\n *\n * Bool search(int a[], int n, int key);\n *\n * a是要搜寻的数组,n是数组内元素的数量,而且key是搜索键。如果key与数组a的某个元素匹配了,\n * 那么 s"
  },
  {
    "path": "codes/CProgramming/ch12_指针和数组/ex_12.c",
    "chars": 1003,
    "preview": "/*\n * 8.2节有一个代码段是用两个嵌套的for循环初始化数组 ident ,此数组是用作恒等矩阵。请重新编写\n * 这段代码,采用一个指针来逐步访问数组中的元素,且每次一个元素。提示:因为不能用 row 和 col\n * 来索引变量,"
  },
  {
    "path": "codes/CProgramming/ch12_指针和数组/ex_13.c",
    "chars": 679,
    "preview": "/*\n * 假设下列数组含有一周24小时的温度读数,数组的每一行是某一天的读数:\n *\n * int temperatures[7][24];\n *\n * 编写语句,使用 search 函数在整个 temperatures 数组中寻找值32"
  },
  {
    "path": "codes/CProgramming/ch12_指针和数组/ex_14.c",
    "chars": 567,
    "preview": "/*\n * 编写循环用来显示出(练习13中的)temperatures数组中行i存储的所有温度读数。利用指针来访\n * 问该行中的每个元素。\n */\n\n#include <stdio.h>\n#include <stdlib.h>\n#incl"
  },
  {
    "path": "codes/CProgramming/ch12_指针和数组/ex_15.c",
    "chars": 510,
    "preview": "/*\n * 编写循环用来显示(练习13中的)temperatures数组一星期中每一天的最高温度。循环体应该调用\n * find_largest 函数,且一次传递数组的一行。\n */\n\n#include <stdio.h>\n\nint fin"
  },
  {
    "path": "codes/CProgramming/ch12_指针和数组/reverse2.c",
    "chars": 338,
    "preview": "/*\n * 程序:数列反向(改进版) \n */\n\n/* Reverses a series of numbers (pointer version) */\n\n#include <stdio.h>\n\n#define N 10\n\nint mai"
  },
  {
    "path": "codes/CProgramming/ch13_字符串/build.sh",
    "chars": 653,
    "preview": "#! /bin/bash\n\n# 自动编译源文件的脚本,使用方法:sh build.sh [rebuild | clear]\n\nall_c_files=`ls *.c`\nexclude_files=\"\"\n\nis_exclude_file() "
  },
  {
    "path": "codes/CProgramming/ch13_字符串/count_space.c",
    "chars": 246,
    "preview": "/*\n * 统计字符串中空格的数量\n */\n\n#include <stdio.h>\n\nint count_space(const char *s)\n{\n\tint count = 0;\n\tfor (; *s != '\\0'; s++)\n\t\ti"
  },
  {
    "path": "codes/CProgramming/ch13_字符串/ex_01.md",
    "chars": 462,
    "preview": "下面的函数调用应该是写出单独一个换行符,但是其中有一些是错误的。请指出哪些调用是错误的,并说明理由。\n\n(a) printf(\"%c\", '\\n'); // 正确\n\n(b) printf(\"%c\", \"\\n\");\t// 错误,\"\\n\"的类型"
  },
  {
    "path": "codes/CProgramming/ch13_字符串/ex_02.md",
    "chars": 215,
    "preview": "假设p的定义如下所示:\n\n```c\nchar *p = \"abc\";\n```\n\n下列哪些函数调用是合法的?请说明每个合法的函数调用的输出,并解释为什么其他的是非法的。\n\n(a) putchar(p);\t\t// 非法的,参数类型不匹配\n\n(b"
  },
  {
    "path": "codes/CProgramming/ch13_字符串/ex_03.c",
    "chars": 324,
    "preview": "/*\n 假设按如下方式调用 scanf 函数:\n scanf(\"%d%s%d\", &i, s, &j);\n 如果用户输入12abc34 56def78,那么调用后i, s和j的值分别是多少?(假设i和j是int型变量,\n s是字符数组)\n*"
  },
  {
    "path": "codes/CProgramming/ch13_字符串/ex_04.c",
    "chars": 714,
    "preview": "/*\n 按照下述要求分别实现 read_line 函数:\n\n (a) 在开始存储输入字符前跳过空白字符。\n (b) 在读入第一个空白字符时停止。提示:调用 isspace 函数来检查字符是否为空白字符。\n (c) 在读入第一个换行符时停止,"
  },
  {
    "path": "codes/CProgramming/ch13_字符串/ex_05.c",
    "chars": 596,
    "preview": "/*\n * (a) 编写名为 strcap 的函数用来把参数中的字母都改为大写字母。参数是空字符结尾的字符串,且此\n * 字符串包含任意的 ASCII 字符。使用数组下标的方式访问字符串中的字符。提示:使用 toupper 函数\n * 把每"
  },
  {
    "path": "codes/CProgramming/ch13_字符串/ex_06.c",
    "chars": 680,
    "preview": "/*\n * 编写名为 censor 的函数,用来把字符串中出现的每一处字母\"foo\"替换为\"xxx\"。例如,字符串\n * \"food fool\"会变为\"xxxd xxxl\"。在不失清晰性的前提下程序越短越好。\n */\n\n#include <"
  }
]

// ... and 1898 more files (download for full content)

About this extraction

This page contains the full source code of the demon90s/CppStudy GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 2098 files (1.2 MB), approximately 585.1k tokens, and a symbol index with 2379 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!