title: How to pass a 3D array as a parameter to function C++? Also Do global variables need to be passed into functions?
body: <p>So I have several questions. First how do I pass a 3D array into a function. I need to pass the whole array as the function is to run a loop to output the contents of the array to a file. This is what I currently have</p>
  
  <pre><code>int array[5][3][3]
  void function(int a[5][3][3])
  {
  //...
  }
  void function(array); //or void function(array[5][3][3]);
  </code></pre>
  
  <p>I have found a way to make it work using pointers to the array, however I have asked my teacher and he does not want us to use pointers.</p>
  
  <p>My second question is if I plan to modify a global variable inside a function, I do not need to pass it to the function? I can just use it inside the function as I would inside main?</p>
  
  <p>Yet another problem I am having now is passing a single value from an array into a function.</p>
  
  <p>In a loop I need to pull a value from an array[i][j][2] (i and j being indexes of an outer and inner loop) and pass it to a function to evaluate whether or not it is greater than 90. This is for a school assignment, so understand there are certain specifications I have to meet. (Like not using pointers, and passing a whole array, and passing one value from an array, because as a class we have not yet learned how to use pointers)</p>