Is the C programming language object-oriented?

If by "is C object oriented?" you mean "is C designed with facilities specifically to support object oriented programming?" then, no, C is clearly not object oriented.


You can program in an object-orientated style in more or less any language. (I think runtime polymorphism -- i.e. virtual methods -- requires a language that supports function pointers.)

Here are a couple of examples:

  • A short summary of object-orientated style in C: http://www.emilmont.net/doku.php?id=c:object_oriented_c
  • A comparison between the same program written in C and C++: http://www.eventhelix.com/realtimemantra/basics/object_oriented_programming_in_c.htm

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), ...


Real programmers can write object-oriented code in ANY language.

But no, C is not an 'object-oriented' language. It has no concept of classes, objects, polymorphism, inheritance.


Answer can be yes or no, depending on:

  • if you ask "is C an object oriented language?", the answer is "no" because it do not have object oriented constructors, keywords, semantic etc...

  • if you intend "can I realize OOP in C?", the answer is yes, because OOP is not only a requirement of a language, but also a way of "thinking", an approach to programming, before to touch some language or another. However the implementation of OOP in C (or any other language not natively designed to be OOP) will be surely "forced" and much hard to manage then any other OOP language, so also some limitation shall be expected.