Definition of CPP

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

CPP

Definition of cpp:- c-pp is a programming language , procedure and object –oriented


programming , static , case sensitive as well as its bottom up approach , cpp is a
Middle level programming language.
Cpp is a extend form of c. => Bjarne was add some keywords and additional feature in c
and make a language that’s language is known as cpp , Bjarne was add class and object
after that add some more feature and add 20 keywords extra.

Program of cpp Program of cpp

Main function () Class and object

Procedure oriented programming:-


#include <iostream>
using namespace std;
int main()
{
int a, b;
cout << "Enter the a and b :- ";
cin >> a >> b;
cout << "the Value of a : - " << a << "the Value of b :- "
<< b;
return 0;
}
Object Oriented programming system: - (class, object) in a oops we use classes
for declare variable and make function and oops programming system is make
vary effective program.

In other words, as the name suggests uses objects in programming. Object-


oriented programming aims to implement real-world entities like inheritance,
hiding, polymorphism, etc. in programming. The main aim of OOP is to bind
together the data and the functions that operate on them so that no other part of
the code can access this data except that function.

Class: - class is blue print of program, in cpp class have three type of specifier

1. Public

2. Private

3. Protected

As well as class is contain with the attributes and behaviors.

Class attributes: - a variable which is declare inside the classes that’s variable is
known as variable of class, data member of class and attributes

Class Behaviors: - a function which is define declare and call inside the class
function is known as class behaviors, method ,data member function of class and
function of class.

Class
Specifiers:-

Attributes

Method s
History of cpp: - introducer: - Bjarne strostrup
In 1979 Bjarne strostrup was add class in c and make
language give the name of language is c with classes at
“bell lab AT&T’s California state united states of
America” after 4 year update their name was change at
1983 “bell lab…..” and give definition of cpp , cpp is a
extend form of c.
How to make class inside the program: - in cpp class is a
user define data only that’s why their declare is outside of
main function in other words we can also say class have
global type deceleration.
Class is declare with the class keyword in cpp.
Syntax of class=>
Class keyword class name

Specifier:
Attributes

Function

Specifier:

Attributes
Attributes
Function
Function

};
Object: - you know class is blue print and if user want
to be blue print convert into real-entity user’s need object.
One class have converts in form of real entity with the
help of one or more then object
In another words we can also say that if user want
To convert blue print into real entity than users need
at least one object which is convert blue print into real
entity. Object help to call attributes and method which is
present inside the class.
#include<iostream>
using namespace std;
class first
{
public:
string name;
int age;
int method()
{
cout<<"Wellcome into myn first methof cpp \n";
cout<<"enter the name of student :- ";
cin>>name;
cout<<"Enter the age of user :- ";
cin>>age;
cout<<"The name of student :- "<<name;
cout<<"The age of student:- "<<age;
}
};
int main()
{
first object;
object.method();
}
HOME WORK
Why we use header file?
Answer :-
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
Learn introduction of cpp
What is class and note on specifier?
What is attributes?
What is method inside the class?

You might also like