i run this program on gcc compiler ,and i got run time error of segmentation
fault.
when i debugged it got segmentation error in the parametrised constructor
why this is so
please help\
code is written below!!!
#include<iostream>
#define SIZE 3
using namespace std;
template <class T>
class array{
T *p;
public:
array();
array(T *a){for(int i=0;i<SIZE;i++) p[i]=a[i];}
friend ostream& operator<<(ostream &dout,array &a)
{
cout<<"\n\n the array elements are : ";
for(int i=0;i<SIZE;i++) dout<<a.p[i]<<" ";
return dout;
}
};