0% found this document useful (0 votes)
16 views

C Plusplus

C++ is an object-oriented programming language that is an extension of C and adds classes, objects, inheritance and polymorphism. It allows for user-defined data types through classes that can model real-world entities and objects of those classes. Structures define collections of variables organized together without reserving memory, while unions define a shared memory address for all data members. Object-oriented programming in C++ focuses on data types, their representation, implementation, behavior and interface through abstraction.

Uploaded by

Nida Waheed
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

C Plusplus

C++ is an object-oriented programming language that is an extension of C and adds classes, objects, inheritance and polymorphism. It allows for user-defined data types through classes that can model real-world entities and objects of those classes. Structures define collections of variables organized together without reserving memory, while unions define a shared memory address for all data members. Object-oriented programming in C++ focuses on data types, their representation, implementation, behavior and interface through abstraction.

Uploaded by

Nida Waheed
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

C++

1. C with Classes.

a. User defined data types.


b. Class real world entity.
i. Class Employee
{
Objects can exist
Object emp1(data-name,salary,phone number);
in hierarchies Object emp2(data-name,salary,phone number);
Object emp3(data-name,salary,phone number);
}
c. Efficient Code Reuse
d. Simplifies program design

2. Struct
a. Define collection of variables organized
b. Struct Date
{
Short int month;
Structure
Short int day; Members
Short int year;
};
c. Doesnt reserve memory.(do not create any variables)
d. Only defines format of structure for later use.
e. C++ improvement
Date date_hired;
3. Union
a. Defines a memory address shared by all of its data members.

4. Object Oriented Programming

a. Characteristics of Data types


i. Data Representation
ii. Implementation
iii. Behavior
iv. Interface
b. Defining Data types
i. Abstraction : Name given to design of a new data type
c.

You might also like