Is the C programming language object-oriented?

后端 未结 16 1222
我寻月下人不归
我寻月下人不归 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:20

    C isn't object oriented. That was the entire purpose behind the ++

    As far as a definition of what it takes to be object oriented: check wikipedia.

    Personally, if it supports inheritance, encapsulation, and polymorphism then your good to go. Another key here is having nice keywords like class and object tend to help...

    Examples of real object oriented languages (not conclusive) are: Smalltalk, Java, c#, Python, Ruby, C++..

    Also, it's possible to have extensions to provide OO features like PHP, Perl, VB (not .Net), ...

提交回复
热议问题