this pointer in c++

What is this pointer in c++: this pointer in c++, This pointer means Every object has access to its own address through an important pointer is called this pointer. When a member function is called, this pointer automatically passed an implicit argument that is a pointer to the invoking object. Example program for this pointer … Read more this pointer in c++

inline function in c++

What is Inline function: An inline function is an important feature of c++, this function is commonly used with class, the function is called using a keyword inline. EXAMPLE FOR INLINE FUNCTION: #include<iostream>Using namespace std;Inline int max(int x,int y){Return a>b?a:b;}Int main(){Cout<<max(10,10);Cout<<””<<max(90,30);Return 0;} Remember if a function cannot be inlined, that function is called a normal … Read more inline function in c++

c++ syntax

The general form of c++ program: (syntax): #includeBase-class declarationDerived-class declarationNonmember function prototypeInt main(){//……….}Nonmember function definition In most of the large project, all class declaration will be put into a header file. And included with each module. In a normal program or project general form remains the same. Recommended Posts: This pointer in c++ Array of … Read more c++ syntax

class in c++

Class: Class is a collection of object, Class is called using the keyword class. General form:Class class-name{Private data and functionsPublic:Public data and functions}object name list; EX: #include<iostream> Using namespace std; Class student { Int roll.No; Char name[20]; Int age; Public: Void read(); Void calc(); Void display(int i); }; Note: a class contain private as well … Read more class in c++

even or odd number c++ || class program

even or odd number class program: In this program find the entered number is Even number or Odd number. Which number is divisible by 2 is known as an even number, and which number is not divisible by 2 is known as an odd number. Program: #include<iostream>using namespace std;class even{ int n,i;public: void read(); void print();};void … Read more even or odd number c++ || class program

Print even numbers in c++ || using class

Print even numbers in c++: Even numbers are the numbers which are divisible by 2 that type number is known as Even numberRemember this 2 point for(i=0;i<n;i++)if(i%2==0) Program: #include<iostream>using namespace std;class even{int n, i;public:void read();void print();};void even::read(){cout<< “enter the number you want to print even number”;cin>>n;cout<<“even number of size”<<n<<“isn”;}void even::print(){for(i=0;i<n;i++)if(i%2==0)cout<<i<<“n”;}int main(){even ob1;ob1.read();ob1.print();} Output: Click  Here … Read more Print even numbers in c++ || using class

C++ program to implement tower of Hanoi || [PROGRAM AND ALGORITHM]

Tower of Hanoi Executable file link available…,Tower of Hanoi is a puzzle game of mathematics, tower of Hanoi is a puzzle invented in 1883. Tower of Hanoi puzzle game consists of 3 Tower of different sizes and disk. Which slide into towers. Algorithm : 1.  Start      Hanoi procedure(disk,source,destination,final) 2.  if disk==1 Then   … Read more C++ program to implement tower of Hanoi || [PROGRAM AND ALGORITHM]