title: Argument for function to edit an array of structs
body: <p>I have a Array of structs <code>struct npc sum[arraysize];</code> in which every struct represents an NPC with different integer values. I want to loop-through <code>sum[i]</code> a set number of times and call a function:</p>
  
  <p><code>int performTask(argument???);</code></p>
  
  <p>This function is supposed to update some integers in the structs (such as one for experience), and return how much experience the npc currently has.</p>
  
  <p>However, I am obviously doing things wrong because whatever I into the function isn't saved in the array. I have tried to pass the struct contained in <code>sum[1]</code> into the function for example. Also to pass pointers as an argument but can't get that to work either.</p>
  
  <p>What would be the proper argument to send in this function in order to edit the structs already saved in the array?</p>
  
  <p>Or more generally, how can I update an array of structs with a function?</p>