Question: DNAStrand(const char* startingString) Our basic constructor - it takes a char array (C-String) and sets the length and creates an array that holds the bases
DNAStrand(const char* startingString) Our basic constructor - it takes a char array (C-String) and sets the length and creates an array that holds the bases listed in the C-String. Where do I go from here? I know that I have the length correct, I just need to know how to assign startingString to bases and I am unaware of how to do so. DNAStrand::DNAStrand(const char* startingString) { length = strlen(startingString);
bases = new char[length + 1];
}
private:
char* bases = nullptr; ///Tracks array contining a char array
int length = 0; ///Length of the char array and DNAStrand
};
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
