C++语言笔记-1
使用书籍: A Tour of C++
作者: Bjarne Stroustrup (C++之父)
Chapter 1
- namespaceThis way can make
1
using namespace std;
stdvisible in the current action scope. Otherwise, we need to use prefix likestd::, which explicitly state the namespace. - C++ can handle override function, but if there exists ambiguity in compiling the code, the compiler will throw an error. Such like:
1
2
3int func(double d1,int i1){}
int func(int i2,double d2){}
int result = func(2,3); - C++ sometime will do implicit conversion. Such like
int a = 7.2, actually,7will be store ina. - C++ allow the declaration in the form
type name {parameter p1...};which seems like constructor. There is no equal between name and brace.
中英名词对照
| 英文 | 中文 |
|---|---|
| namespace | 命名空间 |
| action scope | 作用域 |
| brace | 花括号 |