Docsity

C++ Notes for practical examination, Cheat Sheet of Programming Languages

Toggle sidebar
bg1
Complete C++ Viva Handbook
1. Introduction
C++ is a general-purpose, object-oriented programming language developed by Bjarne Stroustrup.
It extends C and supports procedural as well as object-oriented programming.
2. Features
Object-oriented, fast, portable, reusable code, dynamic memory allocation, templates, exception
handling.
3. Program Structure
Header files, namespace, main() function, statements, return statement.
4. Data Types
int, float, double, char, bool, string.
5. Operators
Arithmetic, relational, logical, assignment, increment/decrement, bitwise, conditional.
6. Control Statements
if, if-else, nested if, switch.
7. Loops
for, while, do-while; break and continue.
8. Arrays & Strings
One-dimensional and two-dimensional arrays; string class and common functions.
9. Functions
Declaration, definition, calling, recursion, function overloading.
10. OOP
Class, object, encapsulation, abstraction, inheritance, polymorphism.
11. Constructors
Default, parameterized and copy constructors; destructor.
12. Inheritance
Single, multiple, multilevel, hierarchical and hybrid.
13. Pointers
Pointer declaration, address operator (&), dereference operator (*), dynamic memory using
new/delete.
pf2

Partial preview of the text

Download C++ Notes for practical examination and more Cheat Sheet Programming Languages in PDF only on Docsity!

Complete C++ Viva Handbook

1. Introduction

C++ is a general-purpose, object-oriented programming language developed by Bjarne Stroustrup. It extends C and supports procedural as well as object-oriented programming.

2. Features

Object-oriented, fast, portable, reusable code, dynamic memory allocation, templates, exception handling.

3. Program Structure

Header files, namespace, main() function, statements, return statement.

4. Data Types

int, float, double, char, bool, string.

5. Operators

Arithmetic, relational, logical, assignment, increment/decrement, bitwise, conditional.

6. Control Statements

if, if-else, nested if, switch.

7. Loops

for, while, do-while; break and continue.

8. Arrays & Strings

One-dimensional and two-dimensional arrays; string class and common functions.

9. Functions

Declaration, definition, calling, recursion, function overloading.

10. OOP

Class, object, encapsulation, abstraction, inheritance, polymorphism.

11. Constructors

Default, parameterized and copy constructors; destructor.

12. Inheritance

Single, multiple, multilevel, hierarchical and hybrid.

13. Pointers

Pointer declaration, address operator (&), dereference operator (*), dynamic memory using new/delete.

14. File Handling

ifstream, ofstream, fstream; open(), close(), read(), write().

15. Exception Handling

try, throw and catch blocks.

16. Templates

Function and class templates for generic programming.

17. Frequently Asked Viva Questions

  • Who developed C++? Bjarne Stroustrup.
  • What is OOP? Programming using classes and objects.
  • Difference between class and object? Class is a blueprint; object is an instance.
  • Difference between constructor and destructor? Constructor initializes objects; destructor releases resources.
  • Difference between while and do-while? do-while executes at least once.
  • Difference between = and ==? Assignment vs comparison.

Quick Revision

Remember the four pillars of OOP: Encapsulation, Abstraction, Inheritance and Polymorphism. Practice simple programs on loops, arrays, functions, classes and inheritance before the viva.