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.
C is a Procedural Oriented language. It does not support object-oriented programming (OOP) features such as polymorphism, encapsulation, and inheritance programming.
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:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With