socket学习
Object Lessons
Posted on
|
Edited on
在C语言中,数据和函数是分开声明的,语言本身并不支持数据和函数之间的关联性
例如1
2
3
4
5
6
7
8
9typedef struct point3d {
float x;
float y;
flaot z;
} Point3d;
void Point3d_print {
//print x,y,z
}
而在C++中,则提供了抽象数据模型给予支持1
2
3
4
5class Point3d {
public:
Point3d(float x...) : _x(x),...{}
void print() {//print x,y,z}
}
然而,这时候就会有人问,加上了封装之后,布局的成本增加了多少?
8086微处理器
Posted on
|
Edited on