Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the C programming language object-oriented?

Tags:

c

oop

standards

People also ask

Why is C not an object oriented programming language?

KEY DIFFERENCE. C is a Procedural Oriented language, whereas C++ is an Object-Oriented Programming language. C supports only Pointers whereas C++ supports both pointers and references. C does not allow you to use function overloading whereas C++ allows you to use function overloading.

Is C object oriented or procedural?

C is a Procedural Oriented language. It does not support object-oriented programming (OOP) features such as polymorphism, encapsulation, and inheritance programming.

Why C is called object oriented language?

C++ is called object oriented programming (OOP) language because C++ language views a problem in terms of objects involved rather than the procedure for doing it.


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.