What's so great about C++? I'm just starting to learn about it and I still don't get the point of object-oriented programming; getters and setters and encapsulation can be done with C structs.
And polymorphism with function pointers.
and more structs :-D
C structures ("structs") do not support 1. Member Functions (for polymorphism) 2. Access Specifiers (for so-called "data hiding") 3. Inheritance C is a structured programming language (only one paradigm) One the other hand, C++ is a multi paradigm programming lanaguage as it supports object oriented programming (to some extent) and structured programming. Will you please explain polymorphism via function pointers?
Nobody explains object-oriented C better than http://www.cs.rit.edu/~ats/books/ooc.pdf
gud link
Here's a more detailed explanation: http://www.codeproject.com/KB/cpp/PolyC.aspx
C++'s strength is in templates and RAII. and while the object-oriented stuff can easily be replicated in C, it's much nicer in C++.
Join our real-time social learning platform and learn together with your friends!