Here are the major difference between C++ and Obj C:
- C++ allows multiple inheritance, Objective-C doesn’t.
- Unlike C++, Objective-C allows method parameters to be named and the method signature includes only the names and types of the parameters and return type (see bbum’s and Chuck’s comments below). In comparison, a C++ member function signature contains the function name as well as just the types of the parameters/return (without their names).
- C++ uses
bool,trueandfalse, Objective-C usesBOOL,YESandNO. - C++ uses
void*andNULL, Objective-C prefersidandnil. - Objective-C uses “selectors” (which have type
SEL) as an approximate equivalent to function pointers. - Objective-C uses a messaging paradigm (a la Smalltalk) where you can send “messages” to objects through methods/selectors.
- Objective-C will happily let you send a message to
nil, unlike C++ which will crash if you try to call a member function ofNULL - Objective-C allows for dynamic dispatch, allowing the class responding to a message to be determined at runtime, unlike C++ where the object a method is invoked upon must be known at compile time (see wilhelmtell’s comment below). This is related to the previous point.
- Objective-C allows autogeneration of accessors for member variables using “properties”.
- Objective-C allows assigning to
self, and allows class initialisers (similar to constructors) to return a completely different class if desired. Contrast to C++, where if you create a new instance of a class (either implicitly on the stack, or explicitly throughnew) it is guaranteed to be of the type you originally specified. - Similarly, in Objective-C other classes may also dynamically alter a target class at runtime to intercept method calls.
- Objective-C lacks the namespace feature of C++.
- Objective-C lacks an equivalent to C++ references.
- Objective-C lacks templates, preferring (for example) to instead allow weak typing in containers.
- Objective-C doesn’t allow implicit method overloading, but C++ does. That is, in C++
int foo (void)andint foo (int)define an implicit overload of the methodfoo, but to achieve the same in Objective-C requires the explicit overloads- (int) fooand- (int) foo:(int) intParam. This is due to Objective-C’s named parameters being functionally equivalent to C++’s name mangling. - Objective-C will happily allow a method and a variable to share the same name, unlike C++ which will typically have fits. I imagine this is something to do with Objective-C using selectors instead of function pointers, and thus method names not actually having a “value”.
- Objective-C doesn’t allow objects to be created on the stack – all objects must be allocated from the heap (either explicitly with an
allocmessage, or implicitly in an appropriate factory method). - Like C++, Objective-C has both structs and classes. However, where in C++ they are treated as almost exactly the same, in Objective-C they are treated wildly differently – you can create structs on the stack, for instance.
Source of Information: Stackoverflow

Couple of things:
1) C++ can have named parameters too. See http://cpp-netlib.github.com/0.9.1/reference_http_server.html#constructor for an example.
2) Generally, calling a method on a null pointer in c++ won’t necessarily segfault. Most implementations segfaults when you acces a member variable.
Also, I believe, Objective-C lacks polymorphic functions. All polymorhpism must be done throught subtype polymorphism.
Furthermore, all of objective-Cs dynamic behaviour can be simulated in C++ by using a map of functions. However, a compile-time type-checked algrebriac type system is impossible in objective-C. For example, using a variant(which is like a union) in C++, the compiler can check that all cases are handled. In objective-C, you have to rely on it being checked at run time. So the edge cases could possibly never be checked for.
Thank you Paul for your contribution.
Very Nice Shahzeb!
It cleared my much ideas about Objective-C. I was worrying about programming in Objective-C. After reading this article, I feeling relax…
Thanks Nadeem.
Thinking about this further, I do not think it pobslsie (or even desirable) to avoid super() completely. If I were to create a class Foo and you created a subclass Bar, what would happen if you were somehow able to bypass Foo’s constructor? And how about Object? Scary code indeed!
Very informative and helpful .
Thanks G. Pramod Kumar
very useful for objective-C beginners!
Cool
C++ now officially uses nullptr, not NULL.