Is the C programming language object-oriented?

后端 未结 16 1194
我寻月下人不归
我寻月下人不归 2021-01-30 16:22

I was talking with a co-worker about C and C++ and he claimed that C is object-oriented, but I claimed that it was not. I know that you can do object-oriented-like things in C,

16条回答
  •  不思量自难忘°
    2021-01-30 17:05

    C is not an O-O language under any definition of "O-O" and "language".

    It is quite easy to use C as the implementation language for a component that gives an O-O API to its clients. The X Windows system is essentially a single-inheritance O-O system when viewed from its API, but a whole mess of C when viewing its implementation.

提交回复
热议问题