title: getting values for an array using scanf function in C
body: <p>I have a function definition that gets values for an array trough the user using scanf. This is what i have</p>
  
  <pre><code>void readInArray(int *arr, int size) {
      int i;
      printf("Enter your list of numbers: ");
      for (i = 0; i &lt; size; i++) {
          scanf("%f", arr[i]);
          printf("%d\n", arr[i]);
      }
  }
  </code></pre>
  
  <p>when i try to print the array i get an error at the line with scanf saying "format specifies type 'float *' but the argument has type 'int'".I tried changing %f to %d so that both scanf and printf have the same place holder </p>
  
  <pre><code>void readInArray(int *arr, int size) {
      int i;
      printf("Enter your list of numbers: ");
      for (i = 0; i &lt; size; i++) {
          scanf("%d", arr[i]);
          printf("%d\n", arr[i]);
      }
  }
  </code></pre>
  
  <p>but i still get the same error. How can i fix this?</p>