0% found this document useful (0 votes)
16 views3 pages

C++ unit 1

Unit 1 introduces Object-Oriented Programming (OOP) with a comparison to Procedural Programming, highlighting features such as structure, focus, and code reusability. It covers key OOP concepts like abstraction, encapsulation, inheritance, and polymorphism, as well as differences between C and C++. The unit emphasizes understanding C++ syntax, decision structures, and the use of pointers and structures.

Uploaded by

sahilsahil69221
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views3 pages

C++ unit 1

Unit 1 introduces Object-Oriented Programming (OOP) with a comparison to Procedural Programming, highlighting features such as structure, focus, and code reusability. It covers key OOP concepts like abstraction, encapsulation, inheritance, and polymorphism, as well as differences between C and C++. The unit emphasizes understanding C++ syntax, decision structures, and the use of pointers and structures.

Uploaded by

sahilsahil69221
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Unit 1 Notes - OOPs with C++ (CAP422J2)

UNIT 1: Introduction to Object-Oriented Programming (15 Hours)

1. Comparison of Procedural Programming and Object-Oriented Programming

(OOP)

| Feature | Procedural Programming | Object-Oriented

Programming |

|------------------------|-------------------------------|-----------------------------|

| Structure | Top-down | Bottom-up |

| Focus | Functions | Objects & Classes |

| Data Access | Globally accessible | Encapsulated |

| Code Reusability | Limited | High |

| Real-world Modeling | Less realistic | More realistic |

2. Benefits of OOP

- Modularity

- Reusability

- Data Hiding

- Scalability

- Real-world Mapping

3. Key OOP Concepts

- Abstraction: Hide unnecessary details.

- Encapsulation: Binding data and methods.


- Inheritance: Code reuse via base and derived classes.

- Polymorphism: One interface, many implementations.

4. Difference between C and C++

| Feature |C | C++ |

|-------------------|------------------------|--------------------------|

| Paradigm | Procedural | Object-Oriented |

| Encapsulation | No | Yes |

| Overloading | Not supported | Supported |

| I/O | scanf/printf | cin/cout |

ELEMENTS OF C++ LANGUAGE

1. Tokens & Identifiers: Smallest units (keywords, constants, etc.)

2. Variables & Constants: Data containers, const/define for constants.

3. Reference Variables: Aliases for existing variables.

4. Data Types: Built-in, Derived, User-defined.

5. Streams: I/O using cin/cout.

6. Operators: Arithmetic, Relational, Logical, Bitwise, etc.

DECISION AND CONTROL STRUCTURES

1. Conditionals: if, if-else, switch

2. Loops: while, do-while, for

3. break/continue: control flow in loops

POINTERS AND STRUCTURES


1. Pointers: Hold memory address of variables.

2. Structures: User-defined grouping of different data types.

Quick Summary:

- Focus on OOP pillars.

- Understand C++ syntax.

- Practice loops, conditionals, pointers, structures.

You might also like