I'm beginner C + + programmer. I have to implement a code that asks you to simulate the election of the president (in a simplified way). The text says to predict 3 classes: 1) Candidate 2) Elector 3) Seat. Seat In Electors can vote up to 10 the list of which is unknown. Each elector expresses the preference of a candidate by inserting a string and stores the data entered anonymously. I do not understand how I should handle this part. I created a class where Elector header declare the default constructor without parameters, I get the output through the overload of operator Flow "<<", full name of each elector, while using the set and get methods to store the id of each elector (I assumed that each voter will have a different id) and use set and get well to store the string that indicates the preference of a candidate. How do I store the value of each string you insert in the class Elector in order to increase the array of objects Candidate? . I think we need to create an array of pointers to an object Candidate .. ? But how do you .. Help!
[ I'm Italian, sorry for my english ]