Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is C++ an Object Oriented language?

Tags:

c++

oop

I have always heard that C++ is not Object Oriented but rather "C with Classes". So, when I mentioned to an interviewer that C++ was not really object oriented, he asked me why I didn't consider it an OO language. I haven't done any C++ since University, and I didn't have much of an answer. Is C++ Object Oriented or not? and why?

like image 505
David Laughlin Avatar asked Aug 17 '10 01:08

David Laughlin


People also ask

Why C is not an object oriented programming language?

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.

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.

Is C object oriented or structured?

C language and Pascal are two common structured programming languages. In the structured programming C, the user can create his own user-defined functions. The main function calls the other functions. It indicates the execution of the program.

Is C is pure object oriented language?

No, it is not a purely object oriented language.


1 Answers

C++ is usually considered a "multi-paradigm" language. That is, you can use it for object-oriented, procedural, and even functional programming.

Those who would deny that C++ is OO generally have beef with the fact that the primitive types are not objects themselves. By this standard, Java would also not be considered OO.

It is certainly true that C++ isn't OO to the same extent as Smalltalk, Ruby, Self, etc. are, but it is definitely an effective OO language by most standards.

like image 178
Drew Hall Avatar answered Sep 21 '22 22:09

Drew Hall