Constructor
Constructor
#include<iostream>
class student
public:
student()
cout<<"constructor is initiated";
};
int main(){
student ob;
return 0;
// scope resolution
#include<iostream>
int j=10;
int main(){
int i = 20;
return 0;
// Types of Constructor
#include<iostream>
using namespace std;
class ConstructorTest{
public:
ConstructorTest()
cout<<"constructor created";
};
int main(){
ConstructorTest ob;
return 0;