title: Reading integers from a file in C
body: <p>I've been struggling with this for a really long time trying to figure it out, I'm guessing it's a really stupid noob mistake but I can't figure it out.</p>
  
  <p>So I'm trying to read in an integer from a file and then do some operations in it, for the sake of the problem I'm just trying to output it here:</p>
  
  <pre><code>FILE * pFile;
  int number;
  pFile = fopen ("myfile.txt","r");
  if (pFile!=NULL) {
  fscanf(pFile, "%d", number);
  fclose (pFile);
  }
  printf("number: %i", number);
  return 0;
  </code></pre>
  
  <p>the contents of myfile.txt:</p>
  
  <pre><code>123
  </code></pre>
  
  <p>but when I run it it doesnt read it anything instead it says </p>
  
  <pre><code>RUN FAILED (exit value 1, total time: 32ms)
  </code></pre>
  
  <p>Thanks for any and all help</p>
  
  <p>EDIT: I forgot to mention, it works as a string, it reads the correct number, but I can't do any operations on it, also if I set the number type to double it works but outputs some random number in the millions...</p>