C++ Program For Constructors
Master C++ with Real-time Projects and Kickstart Your Career Start Now!!
Program 1
// Program for Cnstructor
#include<iostream>
#define clrscr() system("cls")
using namespace std;
class Test
{
int n;
public:
Test()
{
n=100;
}
void incr();
void display();
};
void Test::incr()
{
++n;
}
void Test::display()
{
cout<<n;
}
int main()
{
Test T1,T2;
T1.incr();
T1.incr();
T1.incr();
cout<<"\nT1 Object";
T1.display();
cout<<"\nT2 Object";
T2.display();
}
You give me 15 seconds I promise you best tutorials
Please share your happy experience on Google


you great sir