I want to make a copy constructor for this class RNA to copy the details form another object RNA
#include "RNA.h"
#include"Sequence.h"
#include<bits/stdc++.h>
using namespace std;
RNA::RNA()
{
set_sequence();
}
RNA::RNA(char * seq, RNA_Type atype)
{
int x;
int i=0;
while(1)
{
if(seq[i] != 'C'&&seq[i] != 'G'&&seq[i] != 'A'&&seq[i] != 'U')break;
x++;
i++;
}
x--;
length = x;
this->seq = new char[length];
for(int i=0;i<length;i++)
{
this->seq[i] = seq[i];
}
type = atype;
}
this is the copy constructor
RNA::RNA( RNA& rhs)
{
seq = new char[length];
for(int i=0;i<length;i++)
{
seq[i] = rhs.seq[i];
}
type = rhs.type;
}
in the main I try to do it and it make error
int l;
cin>>l;
char* arr = new char[l];
for(int i=0;i<l;i++)
{
cin>>arr[i];
}
cin>>l;
RNA anas(arr,(RNA_Type)l);
int s;
cin>>s;
char* arr2 = new char[s];
for(int i=0;i<s;i++)
{
cin>>arr2[i];
}
cin>>s;
RNA saeed(arr2,(RNA_Type)s);
saeed(anas); error is here
saeed.Print();
The error is " No match for call to '(RNA) (RNA&)' so what can i do to solve this error