C is not an object-oriented programming language but C++ is an object-oriented programming language. That's why C++ is better than C.
C++ is a statically typed, compiled, general purpose, case sensitive, free form programming language, generic programming and object oriented programming language.
Theory:
The most important thing to do when learning C++ is to focus on concepts and not get lost in
language-technical details. The purpose of learning a programming language is to become a better
programmer; that is, to become more effective at designing and implementing new systems and at
maintaining old ones. For this, an appreciation of programming and design techniques is far more
important than an understanding of details; that understanding comes with time and practice.
C++ supports a variety of programming styles. All are based on strong static type checking, and
most aim at achieving a high level of abstraction and a direct representation of the programmer’s
ideas. Each style can achieve its aims effectively while maintaining run-time and space efficiency.
A programmer coming from a different language (say C, Fortran, Smalltalk, Lisp, ML, Ada, Eiffel,
Pascal, or Modula-2) should realize that to gain the benefits of C++, they must spend time learning
and internalizing programming styles and techniques suitable to C++. The same applies to programmers
used to an earlier and less expressive version of C++.
Use of C++
C++ is used by hundreds of thousands of programmers in essentially every application domain.
This use is supported by about a dozen independent implementations, hundreds of libraries, hundreds
of textbooks, several technical journals, many conferences, and innumerable consultants.
Training and education at a variety of levels are widely available.
What is C++?
C++ is a general-purpose programming language with a bias towards systems programming that
is a better C,
supports data abstraction
supports object-oriented programming, and
supports generic programming
C++ was created as a bridge between \object-oriented programming and C, the world’s
most popular programming language for commercial software development. The goal
was to provide object-oriented design to a fast, commercial software development
platform.
C was developed as a middle ground between high-level business applications languages
such as COBOL and the pedal-to-the-metal, high-performance, but difficult-to-use
Assembler language. C was to enforce “structured” programming, in which problems
were “decomposed” into smaller units of repeatable activities called procedures.
Here is a set of ‘‘rules’’ you might consider while learning C++. As you get more proficient you
can evolve them into something suitable for your kind of applications and your style of programming.
By now, many people have been using C++ for a decade. Many more are using C++ in a single
environment and have learned to live with the restrictions imposed by early compilers and firstgeneration
libraries. Often, what an experienced C++ programmer has failed to notice over the
years is not the introduction of new features as such, but rather the changes in relationships between
features that make fundamental new programming techniques feasible. In other words, what you
didn’t think of when first learning C++ or found impractical just might be a superior approach
today.
C provide features Like
Encapsulation
Inheritance
Polymorphism
Data hiding
Exception Handling
Data Abstraction
Encapsulation
Encapsulation is to put data, properties, and functionality of an object at one place and that place is known as a class. A class is like a structure which we have already studied in C tutorial. In Encapsulation principle or feature the class contains variable, function etc . this is one of the main features of OOP.
Inheritance
It is a process of inheriting properties and functionality of current class into a new class.
In simple words to use variable and function of current class into a new class.
Polymorphism
There two type of Polymorphism
Compile time Polymorphism
Runtime time Polymorphism
Compile time Polymorphism: It is Polymorphism which occurs at compile time like function over loading.
Runtime time Polymorphism: It occurs at runtime like Function overriding
Data hiding
This technique which is used in object-oriented programming (OOP) to hide object's properties and functionality(member variable, member function)
Exception Handling
When a program is designed as a set of modules, error handling must be considered in light of these
modules. Which module is responsible for handling what errors? Often, the module that detects an
error doesn’t know what action to take. The recovery action depends on the module that invoked the operation rather than on the module that found the error while trying to perform the operation.
As programs grow, and especially when libraries are used extensively, standards for handling errors
(or, more generally, ‘‘exceptional circumstances’’) become important.
Data Abstraction
Modularity is a fundamental aspect of all successful large programs. It remains a focus of all design discussions throughout this book. However, modules in the form described previouslare not sufficient to express complex systems cleanly. Here, I first present a way of using modules to provide a form of user-defined types and then show how to overcome some problems with that
approach by defining user-defined types directly.