title: C: scanf to array
body: <p>I'm absolutely new to C, and right now I am trying master the basics and have a problem reading data from scanf straight into an array.</p>
  
  <p>Right now the code looks like this:</p>
  
  <pre><code>int main()
  {
      int array[11];
      printf("Write down your ID number!\n");
      scanf("%d", array);
      if (array[0]=1)
      {
          printf("\nThis person is a male.");
      }
      else if (array[0]=2)
      {
          printf("\nThis person is a female.");
      }
      return 0;
  }
  </code></pre>
  
  <p>As you can see, the program's aim is to ask for an ID, and determine from the first number whether the given the person is male(1) or female(2).
  However it seems I can't get it to work, because the array is not filled properly (this is checked via a printf(array) right after scanf, that results in random numbers).
  Running the program like this will give the result that the person is a male, no matter what number you read in.</p>
  
  <p>So trivial it may seem, I couldn't figure out the problem.</p>