Beruflich Dokumente
Kultur Dokumente
In this unit..
Function Overloading
Operator Overloading
Inheritance
Before we start !
What is a program?
Classes
Objects
Abstraction
Encapuslation
Inheritance
Polymorphism
Class
Object
Encapsulation
Inheritance
Origin of C++
Origin of C++
C++ Compilers
./hello
Header files
Namespace :
int main
return
cout
cerr
clog
cin
cout
Scope of a Variable
Local Variables
Global Variables
C++ offer the programmer a rich assortment of builtin as well as user defined data types.
Bool
Char
Int
Float
Double
Void
Wide character
Modifiers
Signed
unsigned
short
long
Storage Classes
auto
register
static
extern
mutable
Mutable in C++
Conditonal Statements
If
If else
Else if
switch
Looping Statements
While
Do-while
For
C++ Class
A class is the collection of related data and function under a single name.
A C++ program can have any number of classes.
Defining the Class in C++
class class_name {
access_specifier_1:
member1;
access_specifier_2:
member2;
...
} object_names;
Access Specifiers
WAP
This means, within the inner block, the variable x will refer to the
data object declared therein.
Constructors
Constructors
Constructors- Syntax
class A
{
int x;
public:
A(); //Constructor
};