title: Why does the data from my function not pass back to Main?
body: <p>Writing a program that take user input and runs it through a few functions. I can't get changes to the the data in one of the functions to change variable data in the main. </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int convertLoot (int gold , int silver , int bronze, int total);
  int convertBronze (int total, int gold, int silver, int bronze);
  int Spend (int total);
  
  
  int main()
  {
      int gold, silver, bronze, total, *Ntotal ;
      Ntotal= &amp;total;
      printf("Please enter loot amounts.\n");
      printf ("Gold&gt;");
      scanf("%d", &amp;gold);
      printf ("Siver&gt;");
      scanf("%d", &amp;silver);
      printf("bronze&gt;");
      scanf("%d", &amp;bronze);
      convertLoot ( gold, silver, bronze, total );
      printf("total is %d bronze \n", *Ntotal);
      convertBronze(total, gold, silver, bronze); 
      printf("Total loot is %d gold %d silver %d bronze \n", gold, silver, bronze);
  
      Spend ( total);
      convertBronze(total, gold, silver, bronze); 
      printf("total is %d bronze \n", *Ntotal);   
      printf("Total loot is now %d gold %d silver %d bronze \n", gold, silver, bronze);
      return (0);
  }
  
  // Converts loot in bronze. 
  int convertLoot (int gold, int silver, int bronze, int total)
  {
  int conGold= gold*100;
  int conSilver=silver*10;
  int conTotal=conGold+conSilver+bronze;
       total=conTotal;
  
  
      return 0;   
  }
  
  //Convert Bronze Function.
  //Take Total Bronze and reconverts it to Gold Silver and Bronze.
  int convertBronze (int total, int gold, int silver, int bronze)
  {
  
   gold=total/100;
   total=total%100;
   silver=total/10;
   bronze=total%10;
  
  return 0;
  }
  
  
  // spend function
  int Spend (int total)
  {
  int SubGold;
  int SubSilver;
  int SubBronze;
  int Choice;
  int *Ntotal;
  Ntotal= &amp;total;
  printf("What do you wish to spend? \n");
  printf("1 for Gold , 2 for Silver, 3 for Bronze \n");
  scanf("%d", &amp;Choice);
  if (Choice== 1){
  printf("How much Gold? \n");
  scanf ("%d" , &amp;SubGold);
  *Ntotal=total-(SubGold*100);
  return 0;
  }
  else if (Choice== 2){
  printf("How munch Silver? \n");
  scanf("%d" , &amp;SubSilver);
  *Ntotal=*Ntotal-(SubSilver*10);
  
  }
  else if (Choice== 3){
  printf("How much Bronze? \n");
  scanf("%d" , &amp;SubBronze);
  *Ntotal=*Ntotal-(SubBronze);
  
  return 0;
  }
  }
  </code></pre>
  
  <p>changes from the Spend function, has no effect on the "total" variable in main. The second printf statements after the spend function call display the same thing as the ones before the call.</p>