• This topic is empty.
Viewing 1 post (of 1 total)
  • Author
  • #1050


      In particular,

      if (candidates[canc].votes > necand/2)
                  printf("%s", candidates[canc].name);
                  return true;


      The error message received while submitting the project is:

      print_winner did not print winner of election

      // Check if election has been won
              bool won = print_winner();
              if (won)


      t appears that the above code as part of the main function will remain as it is since there is no mention of TO DO.

      My understanding is that the brackets denoting void with print_winner() should give the name of winner candidate as output here if won = true. And that name of winner is coming from print_winner function.


      Although from the current code, getting name of winner candidate as output, unable to figure out the reason behind the error message.



    Viewing 1 post (of 1 total)
    • You must be logged in to reply to this topic.
    Scroll to Top