I have the following class definition
#include <string>
#include "embl.h"
using namespace std;
class Gene{
public:
Gene(EMBL::EmblSaap *cdsinfo,int snp_pos);
private:
string codonseq;
string protein_seq;
string status;
string message;
int readingframe;
// which codon in the protein seq
int codonpos;
// which allele within the codon is the snp based
int allelepos;
string nuc_seq;
};
Within the constructor after filling up the other variables I come
too:-
ahold2=nuc_seq.substr((newsnp_pos-allelepos),3);
cout<<"codon:"<<ahold2<<"\n";
codonseq=ahold2;
newsnp_pos and allelepos are sensible.
When I redefine the class with codonseq as public the code does not
dump core.
I think this problem has something to do with memory allocation, should
I initiliase the strings in someway to prevent this from happening?
regards jake