In the tideman distribution code and the logic itself, the ranks[] array in the vote function is never actually sent outside the vote function. The array that's going to be passed into the record_preferences function is just going to be the ranks[] array defined in main, which isn't updated with the rank entered. How is this supposed to work? I'm not asking about the code or anything because I've got it right but I'm just confused as to why it works.

  • i had the same question too but found that when you pass an array in c to a function to mutate it, it actually decays. Read more here – domster May 19 at 7:26

You must log in to answer this question.

Browse other questions tagged .