You are on page 1of 2

C++ is a general-purpose programming language.

It was designed and implemented


by Bjarne Stroustrup in 1979 at Bell Labs. It runs on a variety of platforms, such as
Windows, MacOS, and the various versions of UNIX. C++ is

 A superset of C
 Supports data abstraction
 Supports object-oriented programming
 Supports generic programming.

Types: Types are fundamental to any program.

C++ has extensive support for types:

 Primitive types(characters, integers, floating-point numbers, etc.)- Defined by the


language itself.
 User-defined types - Provides mechanisms that let us define our own data types.

Primitive Types can be divided into two types:

 Arithmetic Type -
o Integral Types(Characters, integers, boolean values, etc)
o Floating-point types(float, double, etc)
 Void(special type)

Variables: A variable provides us with named storage that our programs can
manipulate.
Each variable in C++ has a type. It determines the size and layout of the variable’s
memory.
It also determines the range of values that can be stored within that memory along
with the set of operations that can be applied to the variable. A simple variable
definition consists of:

 A type specifier.
 A list of one or more variable names separated by commas, and ends with a
semicolon.

Classes and Objects in C++:

 Class is a description of an object.


 An object is an instance of a class
Instance member variable: Attributes, data members, field, properties.
Instance member functions: Methods, procedures, actions, operations, services.

Access Specifier: There are three types of access specifiers in class:

 Private
 Public
 Protected

Features of OOPS: There are primarily four pillars of OOPS:

 Data abstraction: Data hiding


 Inheritance: Reusability
 Polymorphism: Object to take many forms
 Encapsulation: Data hiding

C++ MCQ

You might also like