I'm working on a geneolgoical program where we are coding relatives based on gender and generation, where at the command prompt f for female or m for male is ntered, after which, one has the option to continue (i.e. for the next generation). At the end, the entries appear as a number.
For example, a man's mother's mother would be 100.
Here's what I have so far:
int gen [N];
cout<<"\nmale or female? m or f\n";
cout<<"Next generation? y or n ";
for (int i=0; i<N; ++i)
the problem that I'm having is that it will indeed give a string of numbers, the length of which is correct, but it merely repeats the LAST entry.
For example, if I input m, m, f, f, I should get 1100, but instead
I get 0000.
I'm sorry if I haven't explained it very clearly, but I would appreicate any help.