面试要回顾的知识
Posted 菜菜粥
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了面试要回顾的知识相关的知识,希望对你有一定的参考价值。
1 计算机组成原理的那些通用寄存器等等
2c++ 的内存组织
3
4面向过程设计(procedural programming )也称为:
1).功能分解(Function Decomposition)
2).自上而下逐步求精(top-down design, stepwise refinement)。
5
6
7 static_cast:Used to convert one data type to another and hands all reasonable casts
average = (float) hits / (float) at_bats;
average = static_cast(hits) / static_cast(at_bats);
const_cast:Used to cast away constness.
reinterpret_cast:
dynamic_cast:
8 enum MIN_SIZE = 0,MAX_SIZE = 100 ;
int minVal = MIN_SIZE;
int arr[MAX_SIZE];
9 c++的结构体可以包含函数
struct Point
double x, y;
void setVal(double, double);
;
Point p;
p.x = 3.1415926;
p.y = 1.0;
p.setVal(4.11, -13.090);
10
Inline Function V.S. Macro
Similarities
Each occurrence is replacedwith the definition.
The overhead of a function call is avoided so that the program may execute more efficiently.
The size of the executable image can become quite largeif the expansions are large or there are many expansions.
Dissimilarities
A macro is expanded by the preprocessor, an inline function is expanded by the compiler.
Macro expansions do text substitution without regard to the semanticsof the code; but inline function expansions take into account the semantics.
Macro:No type-safety checking.
Macro:More than once parameter evaluation.
Inline functions are generally preferableto macros.
以上是关于面试要回顾的知识的主要内容,如果未能解决你的问题,请参考以下文章