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

       

      In particular,

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

       

      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)
              {
                  break;
              }

       

      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.


      Reply


      https://edstem.org/us/courses/176/discussion/2419750?comment=5530115[learn_press_profile]

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