Please help me to find error in this program .I am trying to add data to a dynamic array .
#include<iostream.h>
#include<conio.h>
#include<string.h>
class data
{
private:
char(* dynamicarray)[20];
int size1,i;
public:
data(char(*tmp)[20],int Size)
{
dynamicarray = new char(Size([20]);
dynamicarray = tmp;
size1 = Size;
}
get()
{
for(i=0;i<size1;i++)
{
cout<<dynamicarray[i];
}
}
};
main()
{
char array1[5][20] ={"tom","dick"};
int Size1 =5;
data obj;
obj.data(array1,Size1);
data g;
obj.get();
return 0;
}