title: Simple number guessing game using binary search algorithm in C
body: <p>This program requires me to: <em>Write a program that plays a simple number-guessing with its user. The user thinks of a number and then answers a series of questions asked by the computer until it correctly guesses the
  number.</em></p>
  
  <p>My problem is that the compiler says that: <em>'arr' undeclared (first use in this function)</em></p>
  
  <p>Here is my code so far:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include "strlib.h"
  #include "simpio.h"
  
  #define size 200
  
  int binSearch (int num);
  void getArray (int arr[]);
  
  main()
  {
        printf("Think of a number in the range of 1-200 and I'll guess it.\n");
        int arr[size];
        getArray(arr);
        binSearch(arr);
        getchar();
  }
  
  void getArray (int numbers[])
  {
        int number;
  
        for(number=1;number&gt;=200;number++)
        {
                   arr[number]=number;                                 
        }    
  }
  
  int binSearch(int num)
  {
        int low, high, mid;
        string strReply;
  
        low=0;
        high=size-1;
  
        while(low&lt;=high);
        {
                   mid=low+high/2;
                   printf("\nIs the number %d ?\t", mid);
                   strReply= GetLine();
                   if(StringEqual(strReply, "no"))
                   {
                            printf("Is the number less than %d ?\t", mid);
                            if(StringEqual(strReply, "no"))
                            { 
                                       high=mid-1;                         
                            }
                            else if(StringEqual(strReply, "yes"))
                            {
                                       low=mid+1;     
                            }
                   }
                   else if(StringEqual(strReply, "yes"))
                   { 
                            return(mid);     
                   }
                   else
                   {
                            return(-1);    
                   } 
  }
  </code></pre>
  
  <p>Thank you :)</p>