-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtutorial1.cpp
43 lines (36 loc) · 906 Bytes
/
tutorial1.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include<bits/stdc++.h>
using namespace std;
/*
A Class is a user defined data-type having it's own data members and member functions,
and it acts like a blue print for an Object.
An Object is a variable of type Class.
1. defining a class
class class_name
{
private:
data members
member functions
public:
data memebrs
member functions
protected:
data members
member functions
};
2. private, public and protected are the access specifiers i.e. they define visibility level
3. If nothing mentioned data member or member functions will be considered private
4. to access data member or member function we use "." attribute
*/
class HumanBeing
{
public:
void Introduce()
{
cout<<"I am a Human Being!"<<endl;
}
};
int main()
{
HumanBeing Saurav; // Declaring an Object of type HumanBeing in the stack
Saurav.Introduce();
}