title: How to pass an array to a function?
body: <p>Code:</p>
  
  <pre><code>void case1();
  void case2();
  void case3();
  void case4();
  void case5();
  
  //Global variables
  const int MAXROW = 5;
  const int MAXCOL = 5;
  
  int main()
  {
      ........
      ...
  MENU(with do while)
  }
  
  void case1()
  {
      int A[MAXROW][MAXCOL] = { 0 };
  
      for (int r = 0; r &lt; MAXROW; ++r)
          for (int c = 0; c &lt; MAXCOL; ++c) {
              cout &lt;&lt; "\n A[" &lt;&lt; r &lt;&lt; "][" &lt;&lt; c &lt;&lt; "]= ";
              cin &gt;&gt; A[r][c];
          }
  }
  
  void case2()
  {
      ...
  }
  
  //Function to find average of negatives
  void case3()
  {
      int negNumber = 0;
      double average = 0;
  
      for (int r = 0; r &lt; 6; ++r) {
          for (int c = 0; c &lt; 6; ++c) {
              if...
  }
  
  void case4()
  {//Function to find product of numbers different from 0
      ...
  }
  
  void case5()
  {
      ...
  }
  </code></pre>
  
  <p>As you can see the input array is in <code>case1()</code>. What I wonder is how to use this array in all other functions (<code>case2</code>, <code>case3</code>, <code>case4</code>, <code>case5</code>).</p>
  
  <p>How can I do this?</p>
  
  <p>How to call them in the menu? For example <code>case2()</code>:</p>
  
  <pre><code>case '2': {
      case2(......);
  </code></pre>
  
  <p>For now my error list is full of messages like</p>
  
  <blockquote>
    <p>'A': undeclared identifier</p>
  </blockquote>