title: How to check the data type of elements in an array C
body: <p>trying to error check the elements put into an array to make sure that they are</p>
  
  <p>1)between 1 and 42</p>
  
  <p>2)of data type int</p>
  
  <p>any suggestions on how to do so?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #define SIZE 6
  
  int main()
  {
  int i;
  int numbers[SIZE];
  
   for(i=0;i&lt;SIZE;i++)
  {
      printf("Enter number %d of your 6 numbers, between 1 and 42(integers only)!",i+1);
      scanf("%d",*(numbers+i));
      if(*(numbers+i)&lt;1 || *(numbers+i)&gt;42 || *(numbers+i) != /*data type int*/)
      {
          printf("Invlaid input");
      }
      else
      {
          printf("Valid input");
      }
  }
  
  getchar();
  getchar();
  return 0;
  }
  </code></pre>