title: c pass array by value?
body: <p>I have this homework problem:</p>
  
  <p>Part A</p>
  
  <p>Write a C program that tests whether or not the following data types are passed by reference or by value, and prints what it discovers out to the terminal:</p>
  
  <ul>
  <li>int</li>
  <li>array of ints</li>
  </ul>
  
  <p>Hypothetically, if your program discovers that an int is passed by value and an array of ints is passed by value, then it should produce output like:
   int: pass-by-value
  array of ints: pass-by-value</p>
  
  <p>The int I understand, but what I don't get is:</p>
  
  <ol>
  <li>I thought the only way to pass an array was to pass the address of the first value in the array</li>
  <li>does this count as passing by value or passing by reference? ( <a href="https://stackoverflow.com/questions/4774456/pass-an-array-to-a-function-by-value">Pass an array to a function by value</a> confused me)</li>
  <li>Hints on how I can do this? I'm assuming something like passing the reference to another function, manipulating it, and seeing if it changed, but I'm not sure....</li>
  </ol>
  
  <p>Edit: might help if someone explained this to me with a concrete example, such as: Say I have an array of length 10 ints stored at memory location 0 (yeah, I know, not real life, but for the sake of the example...). What would it look like if that array was passed by reference? What would it look like if it was passed by value?</p>