I took your advice to heart and spent last night reading up. The entire program works as it should now except for one last problem. I get an incorrect character at the end of my sequence
array.
When I run my code I get a char from the next array at the end. It displays in my test loop: example
I'm hoping this is just a simple problem and not another conceptual one. Any help is appreciated!
My code is as follows:
void promptNames(int numberRelatives, char relative[][256])
{
char name[256];
for (int a = 0; a < numberRelatives; a++)
{
cout << "Please enter the name of relative #" << a + 1 << ": ";
cin >> relative[a];
}
cout << endl;
}
void promptSequence(int numberRelatives, char relative[][256],
char sequence[][9])
{
string tempString;
for (int b = 0; b < numberRelatives; b++)
{
cout << "Please enter the DNA sequence for ";
cout << relative[b] << ": ";
cin >> tempString;
for (int c = 0; c <= 9; c++)
{
sequence[b][c] = tempString[c];
}
}
for (int k = 0; k <= numberRelatives; k++) //testing what sequence will be
{
for (int g = 0; g < 10; g++)
{
cout << sequence[k][g];
}
cout << endl;
}
cout << endl;
}