zavier / blogs-comments

博客评论
0 stars 0 forks source link

C语言实现的封装,继承,多态 | 郑伟的博客 #29

Open zavier opened 4 years ago

zavier commented 4 years ago

https://zhengw-tech.com/2020/01/27/oop-c/#more

提到面向对象编程,我们想到的就是封装、继承、多态,但是其实这几个特性并不是面向对象编程所独有的,C语言也是基本支持这三个特性的,下面我们来具体看下 封装1234// point.hstruct Point;struct Point makePoint(double x, double y);double distance(struct Point p1, struct Point *p2);