Object-orientation in C

前端 未结 22 1689
孤城傲影
孤城傲影 2020-11-22 15:26

What would be a set of nifty preprocessor hacks (ANSI C89/ISO C90 compatible) which enable some kind of ugly (but usable) object-orientation in C?

I am familiar with

22条回答
  •  长情又很酷
    2020-11-22 16:17

    @Adam Rosenfield has a very good explanation of how to achieve OOP with C

    Besides, I would recommend you to read

    1) pjsip

    A very good C library for VoIP. You can learn how it achieves OOP though structs and function pointer tables

    2) iOS Runtime

    Learn how iOS Runtime powers Objective C. It achieves OOP through isa pointer, meta class

提交回复
热议问题