[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]


    Search the Q&A Archives


is c object-oriented and if so is c++ also object-oriented? ...

<< Back to: Objective-C FAQ

Question by BONE
Submitted on 2/2/2004
Related FAQ: Objective-C FAQ
Rating: Rate this question: Vote
is c object-oriented and if so is c++ also object-oriented?



Answer by Angelo
Submitted on 2/11/2004
Rating:  Rate this answer: Vote
no, and yes

("yes, and yes" if you were referring to "objective c" and not just "c")

 

Answer by Nick
Submitted on 4/13/2004
Rating:  Rate this answer: Vote
C is not object oriented at all. There are tricks you could use to implement class-like behaviour (for example, polymorphism through a struct full of function pointers) but these won't be strictly type-checked. And good luck implementing inheritance through custom vtables.

ObjC is object oriented for certain. Its syntax derives heavily from Smalltalk, a pure-OO language.

C++ is also object oriented, sort of. Stroustrup describes C++ as a multiparadigm programming language where you can choose your paradigm. So if OO is your bag, you're free to code OO in C++. C++ also supports pure-Functional programming (as does C and by extension ObjC), declarative programming (through templates) and others (these are left as an exercise to the reader).

As a side note, some people would note that since both ObjC and C++ are imperative programming languages they can't possibly be object oriented. Myself, I can't see any conflict between being an imperative language and an OO one.

References:
multiparadigm programming, http://www.research.att.com/~bs/bs_faq.html#multiparadigm
Smalltalk, http://www.smalltalk.org/
Imperative language, http://en.wikipedia.org/wiki/Imperative_programming

 

Answer by dina
Submitted on 1/2/2005
Rating: Not yet rated Rate this answer: Vote
C is procedure-oriented programming & c++ is object oriented programming.

 

Answer by rashmi
Submitted on 6/4/2007
Rating: Not yet rated Rate this answer: Vote
c is not object oriented..., c++ is object oriented but not pure object oriented...

 

Your answer will be published for anyone to see and rate.  Your answer will not be displayed immediately.  If you'd like to get expert points and benefit from positive ratings, please create a new account or login into an existing account below.


Your name or nickname:
If you'd like to create a new account or access your existing account, put in your password here:
Your answer:

FAQS.ORG reserves the right to edit your answer as to improve its clarity.  By submitting your answer you authorize FAQS.ORG to publish your answer on the WWW without any restrictions. You agree to hold harmless and indemnify FAQS.ORG against any claims, costs, or damages resulting from publishing your answer.

 

FAQS.ORG makes no guarantees as to the accuracy of the posts. Each post is the personal opinion of the poster. These posts are not intended to substitute for medical, tax, legal, investment, accounting, or other professional advice. FAQS.ORG does not endorse any opinion or any product or service mentioned mentioned in these posts.

 

<< Back to: Objective-C FAQ


[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]

© 2008 FAQS.ORG. All rights reserved.