From 6dd52daea4db1d4843f58050f60a3312bcafc0cf Mon Sep 17 00:00:00 2001 From: huihut Date: Sun, 16 Jun 2019 22:26:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20C=20=E5=AE=9E=E7=8E=B0=20C?= =?UTF-8?q?++=20=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/huihut/interview/issues/12#issuecomment-501953095 --- README.md | 8 +++++++- README_Details.md | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 98ad632a..ea52b233 100644 --- a/README.md +++ b/README.md @@ -429,7 +429,13 @@ int main() { ### C 实现 C++ 类 -> [C 语言实现封装、继承和多态](http://dongxicheng.org/cpp/ooc/) +C 实现 C++ 的面向对象特性(封装、继承、多态) + +* 封装:使用函数指针把属性与方法封装到结构体中 +* 继承:结构体嵌套 +* 多态:父类与子类方法的函数指针不同 + +> [Can you write object-oriented code in C? [closed]](https://stackoverflow.com/a/351745) ### explicit(显式)关键字 diff --git a/README_Details.md b/README_Details.md index 9a1f1b9c..0b7d9ae0 100644 --- a/README_Details.md +++ b/README_Details.md @@ -438,7 +438,13 @@ int main() { ### C 实现 C++ 类 -> [C 语言实现封装、继承和多态](http://dongxicheng.org/cpp/ooc/) +C 实现 C++ 的面向对象特性(封装、继承、多态) + +* 封装:使用函数指针把属性与方法封装到结构体中 +* 继承:结构体嵌套 +* 多态:父类与子类方法的函数指针不同 + +> [Can you write object-oriented code in C? [closed]](https://stackoverflow.com/a/351745) ### explicit(显式)关键字