title: Void function error (value computed is not used)
body: <p>Hi all I have tried a couple variations of my code and I can't figure out how to resolve these warnings. </p>
  
  <ul>
  <li>The objective is to create a modular representation of the monty hall problem in c</li>
  </ul>
  
  <p><strong>Problem</strong></p>
  
  <ul>
  <li>My <strong>outputFinalResult</strong> function fails to give me correct output</li>
  </ul>
  
  <p><strong>Error Messages</strong></p>
  
  <pre><code> -  gcc -Wall monteball.c
  
  monteball.c: In function ‘determineOutcomeStay’:
  
  monteball.c:125:7: warning: value computed is not used [-Wunused-value]
  
  monteball.c:127:3: warning: value computed is not used [-Wunused-value]
  
  monteball.c: In function ‘determineOutcomeSwitch’:
  
  monteball.c:134:7: warning: value computed is not used [-Wunused-value]
  
  monteball.c:136:3: warning: value computed is not used [-Wunused-value]
  
  monteball.c: In function ‘getFinalChoice’:
  
  monteball.c:119:1: warning: control reaches end of non-void function [-Wreturn-type]
  </code></pre>
  
  <p>an aside should I be worried about this warning?</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>void outputFinalResult (int winStay, int winSwitch, int stayCount, int switchCount);
  //function is 4 print statements using arguments calculated by determineOutcome functions
  int main (int argc, char * argv [])
  {
    srand(time(NULL));
    int counter = 10000;
    int i = 0;
    int winStay;
    int winSwitch = 0;
    int stayCount;
    int switchCount = 0;
    int firstChoice;
    int grandPrize;
    int revealedDoor;
    int finalChoice;
  
    for (i = 0; i &lt; counter; i++)
    {
      firstChoice = getUserChoice ();
  
      grandPrize = determinePrizeLocation ();
  
      revealedDoor = revealDoor (firstChoice, grandPrize);
  
      finalChoice = getFinalChoice (firstChoice, grandPrize, revealedDoor);
  
      if(finalChoice == firstChoice)
      {
        determineOutcomeStay(finalChoice, grandPrize, &amp;winStay, &amp;stayCount);
      } else
      {
        determineOutcomeSwitch(finalChoice, grandPrize, &amp;winSwitch, &amp;switchCount);
      }
  
    }
  
    outputFinalResult (winStay, winSwitch, stayCount, switchCount);
    return 0;
  }
  int getFinalChoice (int firstChoice, int grandPrize, int revealedDoor)
  {
    int finalChoice;
    int switchProbability = rand () % 2 + 1; // 50% chance of keeping or switching choice                                                                                            
  
    if (switchProbability == 1) // Represents user keeping their choice                                                                                                              
    {
      return firstChoice;
    }
  
    else if (switchProbability == 2) // Represents user switching their choice                                                                                                       
    {
      finalChoice = rand () % 3 + 1; // Randomizes finalChoice btw 1-3                                                                                                             
  
      while (finalChoice == revealedDoor || finalChoice == firstChoice) // Ensures that finalChoice isn't the door that was eliminated or                                          
      {                                                                 // the door that was initially selected                                                                  
        finalChoice = rand () % 3 + 1;
      }
  
      return finalChoice;
    }
  }
  
  void determineOutcomeStay(int choice, int grandPrize, int * winStay, int * stayCount)
  {
    if(choice == grandPrize)
    {
      *winStay++;
    }
   *stayCount++;
  }
  
  void determineOutcomeSwitch(int choice, int grandPrize, int * winSwitch, int * switchCount)
  {
    if(choice == grandPrize)
    {
      *winSwitch++;
    }
    *switchCount++;
  }
  </code></pre>
  
  <p>Sorry for the long post just trying to give all the info need to receive a good answer. Please message me if additional info is needed. Thanks.</p>