How can we initialize array elements by use constructor to this code

#include
#include<conio.h>
class swaparray
{
int arr[100];
int swap();
public:
int i, n;
int enterdata();
int display();
};

int swaparray::enterdata()
{
std::cout<<“Enter the range of array:\n”;
std::cin>>n;
std::cout<<“Enter the elements of array:\n”;
for(i=0;i<n;i++)
{
std::cin>>arr[i];
}

}

int swaparray::display()
{
std::cout<<“Elements of array:\n”;
for(i=0;i<n;i++)
{
std::cout<<arr[i]<<"\t";
}
std::cout<<"\nAfter Swapping first and last elements then array is\n";
swap();
for(i=0;i<n;i++)
{
std::cout<<arr[i]<<"\t";
}
}
int swaparray::swap()
{
int temp;
temp=arr[0];
arr[0]=arr[n-1];
arr[n-1]=temp;

}

int main()
{
swaparray s1;
s1.enterdata();
s1.display();
getch();
return 0;
}

Well in this program specifically you dont need to use constructor. Anyways here is the syntax of using constructor.

Class YOUR_CLASS_NAME{
// Defining the constructor
YOUR_CLASS_NAME(Parameter_1, <Parameter_2> )
{
//Do some work or value assignment in the
constructor. You can use the parameter values
passed too.
}
};
void main()
{
//Creating object of the class which will automatically call the constructor.
YOUR_CLASS_NAME objectName (parameter_1, parameter_2);
}

I hope it will give you an idea. Any questions do reply.
If interested you can follow me on Github too (www.github.com/amannirala13)