Creating instance or Creating object
Instance(also known as object) is a real world entities. We can access the fields and methods of the class using an object. So far, we created variables using datatypes like int, double, string etc. A class can also be used like a datatype. The variables declared using class is known as object or instance. We can create an instance of any class in C++ using below syntax. To access the class members(fields and methods), we use the dot (.) operator after the object name. The dot operator links the name of an object with the name of a class member.
CODE
EG 1 . Creating Rectangle class with fields and variables and creating instance.
#include <iostream>
using namespace std;
class Rectangle {
  public:
    double length, width, height;
    double Area() {
        return length * width;
    }
    double Perimeter() {
        return 2 * (length+width);
    }
    double Volume() {
        return Area() * height;
    }
};
int main() {
    //Here wall is an object which is a real world entity
    Rectangle wall;
    wall.length = 5;
    wall.width = 6;
    wall.height = 7;
    cout << wall.Area() << endl;
    cout << wall.Volume() << endl;
    cout << wall.Perimeter() << endl;
}
EG 2 . Creating Class called car with fields and variables
#include <iostream>
using namespace std;
class Car {
  public :
    string color;
    int weight, numberOfSeats;
    void Drive() {
        cout << "Start Driving" << endl;
    }
    double CarryingLoadCapacity() {
        return (numberOfSeats*65)+30; //65 is the average weight of a person in kgs, 30kgs for extra load for accessories,fuel etc.
    }
};
int main() {
        Car TataNexon;
        TataNexon.color = "Red";
        TataNexon.weight = 1315;
        TataNexon.numberOfSeats = 5;
        //Drive() is void method hence cannot be written inside cout
        TataNexon.Drive();
        cout << "Carrying Load Capacity = " << TataNexon.CarryingLoadCapacity() << "kg" << endl;
}
(Click Here, For more exercises)