title: load array from a file
body: <p>I'm saving the elements of array using <code>fwrite</code> and I'm trying to load that previous saved data to the array using <code>fread</code>. The return value of <code>fread</code> is non-zero, which means it was successful. But when I print the array, it's empty, nothing is getting printed.
  I've saved the array to a file as</p>
  
  <pre><code>fwrite(num, sizeof(int), k, q); //num is the same array, k=no of elements, q is the file pointer
  </code></pre>
  
  <p>Here's my code :</p>
  
  <pre><code>int num[50], NoOfElement;
  FILE *p;
  if(p = fopen("data.txt", "rb") == NULL)
  {
      printf("Error");
      exit(1);
  }
  fseek(p, 0, SEEK_END);
  NoOfElement = ftell(p) / sizeof(int); //no of elements in the file
  fseek(p, 0, SEEK_SET);
  fread(num, sizeof(int), NoOfElement, p);
  </code></pre>