C++ Primer 3rd 读书笔记 1
第一篇 C++概述
程序=算法+数据 程序设计方法:过程化程序设计方法-基于对象程序设计方法-面向对象程序设计方法 add class add inheritance,dynamic binding C++是一种支持多种程序设计方法的语言 基础:穿越操作符优先级或标准算术转换规则的迷宫
第1章 开始 1.1 问题的解决 策略:divide and conquer stepwise refinement
1.2 C++程序 Function: 返回类型 函数名 参数表 函数体 function prototype 哑函数 void用来指定一个没有返回值的函数 渐进式生成程序的方法 #include=preprocessor directive iostream是输入/输出流库标准文件 编译器的工作: 1 分析程序代码的正确性 2 转换正确的程序代码=code generation 编译器不能判断程序的语义是否正确 但能够判断出程序形式上的错误 1 语法错误 2 类型错误 在内置类型之间经常发生隐式的类型转换conversion 内置的基本数据类型: int float char boolean 扩展的基本数据类型: string complex number vector list
? 1 using指示符 2 vector's example
1.2.1 程序流程控制 e.g.1 if e.g.2 while use iterate and loop
? e.g.1 if count=1 what happened?
1.3 预处理器指示符 如果文件名用<>括起来 表明这个文件是一个工程或者标准头文件 如果文件名用""括起来 表明该文件是用户提供的头文件 #ifndef #define #endif Guess: ifndef=if not define?
? 只要不存在“两个必须包含的头文件要检查一个同名的预处理器常量”这样的情形? 
|