- What computer understand?
bits - Assembler Language
- Limited structure
- Global scope
- Machine code
- Primitive High-Level Language
-Function decomposition 功能分解
-Data separation
-High-level structure - Block Structured Language
- Encapsulation 封装
- Flexible data scoping
- Modularization
- Object-Oriented Language
- Inheritance 继承
- Polymorphism 多态
- Abstract data types 抽象数据类型
C++ history
-
1972, Dennis Ritche, C language
-
1980, Bjarne Stroustrup, C extension/ C language with class
-
1983, C++ named
-
1997, ANSI(American National Standards Institute) C++(standard C++)
-
Standard C++: ANSI C++ is more scalable to different platform such as UNIX, Microsoft windows, Mac...高可移植性
-
The standard C++ library got supported by most of industry providers.
-
You'd better don't know C.
-
We will try to avoid C library and C syntax.
-
A C++ file can be with .cc, .cp, .cpp extensions.
-
Supports data abstraction and objection-oriented programming
-
Contains all existing features of C, making the migration from C to C++ relatively easy
-
Is as portable and efficient as C
-
Can be linked to existing C libraries and functions
-
Provides strong static-type checking
-
Is a general-purpose language
计算机基础知识
- 栈:系统自动管理的一小片内存空间
- 堆:交给程序员使用的一大片内存空间
Binary: 0101 1000
Decimal: 88
Hexadecimal: 0x58
1 byte= 8bits
负数用补码表示:正数二进制,按位取反,+1
- 编辑器:UNIX下vi编写源程序, 保存:wq,:x,ZZ
- 编译器:g++ -c得到目标文件
- 连接器:g++ 得到可执行文件(命令文件)
网友评论