UNIT I
Syllabus: Introduction to C++: Difference between C and C++, Evolution of C++,
The Object Oriented Technology, Disadvantage of Conventional Programming,
Key Concepts of Object Oriented Programming, Advantage of OOP, Object
Oriented Language.
1. Introduction:
C++ is an object oriented programming language, C++ was
developed by Jarney Stroustrup in 1983 at AT & T Bell laboratories, USA.
C++ was developed from C and simula 67 language. C++ was early called ‘C
with classes’.
• C++ is derived from C Language. It is a Superset of C.
• Earlier C++ was known as C with classes.
• In C++, the major change was the addition of classes and a mechanism for
inheriting class objects into other classes.
• Most C Programs can be compiled in C++ compiler.
• C++ expressions are the same as C expressions.
• All C operators are valid in C++.
2. Differences between C and C++
Following are the differences Between C and C++ :
S.No. C C++
C is Procedural Language. C++ is non Procedural i.e Object
oriented Language.
1
2 No virtual Functions are present in C The concept of virtual Functions
are used in C++.
WWW.JNTUKNOTES.COM
,3 In C, Polymorphism is not possible. The concept of polymorphism is
used in C++.
Polymorphism is the most
Important Feature of OOPS.
4 Operator overloading is not possible in Operator overloading is one of the
C. greatest Feature of C++.
5 Top down approach is used in Program Bottom up approach adopted in
Design. Program Design.
6 No namespace Feature is present in C Namespace Feature is present in
Language. C++ for avoiding Name
collision.
7 Multiple Declaration of global variables Multiple Declaration of global
are allowed. varioables are not allowed.
8 In C++
In C
• Cin>> Function used for
• scanf() Function used for Input. Input.
• printf() Function used for output. • Cout<< Function used for
output.
9 Mapping between Data and Function is Mapping between Data and
difficult and complicated. Function can be used using
"Objects"
10 In C, we can call main() Function In C++, we cannot call main()
through other Functions Function through other
functions.
11 C requires all the variables to be defined C++ allows the declaration of
at the starting of a scope. variable anywhere in the scope
i.e at time of its First use.
12 No inheritance is possible in C. Inheritance is possible in C++
WWW.JNTUKNOTES.COM
,13 In C, malloc() and calloc() Functions are In C++, new and delete
used for Memory Allocation and free() operators are used for Memory
function for memory Deallocating. Allocating and Deallocating.
14 It supports built-in and primitive data It support both built-in and user
types. define data types.
15 In C, does not provide direct support to In C++, Exception Handling is
Eexception handling. done with Try and Catch block.
3. Evolution of C++
C++ is an object oriented programming language and also considered as an
extension of C. Bjarne Stroustrup at AT&T Bell Laboratories in Murray Hill, New
Jersey (USA) developed this language in the early 1980s. Stroustrup, a master of
Simula67 and C, wanted to combine the features of both the languages and he
developed a powerful language that supports object-oriented programming with
features of C. The outcome was C++ as per Fig. 1.1. Various features were derived
from SIMULA67 and ALGOL68. Stroustrup called the new language ‘C with
classes’. However, in 1983, the name was changed to C++.
WWW.JNTUKNOTES.COM
, Fig. 1.1 Evolution of C++
The thought of C++ came from the C increment operator ++. Rick Mascitti coined
the term C++ in 1983. Therefore, C++ is an extension of C. C++ is a superset of C.
All the concepts of C are applicable to C++ also.
For developing complicated applications, object oriented language such as C++ is
the most convenient and easy. Hence, a programmer must be aware of its features.
4. THE OBJECT ORIENTED TECHNOLOGY
Nature is composed of various objects. Living beings can be categorized into
different objects.
Let us consider an example of a teaching institute which has two different working
sections – teaching and non-teaching. Further sub-grouping of teaching and
nonteaching can be made for the coordination of management. The various
departments of any organization can be thought of as objects working for certain
goals and objectives.
Usually an institute has faculty of different departments. The Director/Principal is a
must for the overall management of the institute. The Academic Dean is responsible
for the academics of the institute. The Dean for Planning should have the future plans
of the institute and he/she must see how the infrastructure is utilized effectively. The
Dean R&D should see research activities run in the institute forever.
Besides teaching staff there must be laboratory staff for assistance in conducting
practical sessions, and a site development section for beautification of the campus.
The accounts department is also required for handling monetary transactions and
salaries of the employees. The Sports section is entrusted the responsibility of sports
activities. The Registrar for Administration and staff for dealing with administrative
matters of the institute are also required. Each department has an incharge who
carries clear-cut given responsibilities. Every department has its own work as stated
above. When an institute’s work is distributed into departments as shown in Fig. 1.2,
it is comfortable to accomplish goals and objectives. The activities are carried on
smoothly. The burden of one particular department has to be shared among different
departments with personnel. The staff in the department is controlled properly and
act according to the instructions laid down by the management. The faculty performs
activities related to teaching. If the higher authority needs to know the details
regarding the theory, practical, seminar and project loads of individuals of the
WWW.JNTUKNOTES.COM
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through EFT, credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying this summary from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller chiranjeevijami. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy this summary for R102,47. You're not tied to anything after your purchase.