Skip to content

Commit

Permalink
修改 C 实现 C++ 类
Browse files Browse the repository at this point in the history
  • Loading branch information
huihut committed Jun 16, 2019
1 parent b602804 commit 6dd52da
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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(显式)关键字

Expand Down
8 changes: 7 additions & 1 deletion README_Details.md
Original file line number Diff line number Diff line change
Expand Up @@ -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(显式)关键字

Expand Down

0 comments on commit 6dd52da

Please sign in to comment.