title: fopen() not working in C
body: <p>I got it fixed. Thanks for all the help.</p>
  
  <p>I've now looked through quite a few articles, forum posts and topics here; however, none have actually fixed my issue. The problem is that my <code>fopen("file.txt", "w");</code> doesn't create the file.</p>
  
  <p>Code:</p>
  
  <pre><code>//
  //Includes
  #include &lt;stdio.h&gt;
  
  int main ()
  {
      FILE *receipt = fopen("receipt.txt", "w");
  
      //Create file
      fprintf(receipt, "Price: %.2f$", purchase);
      fprintf(receipt, "\nDiscount: %.2f$", discount);
      fprintf(receipt, "\nTax %%: %.2f%%", tax_pct);
      fprintf(receipt, "\nTaxes: %.2f$", tax);
      fprintf(receipt, "\nTotal Price: %.2f$", end_price);
      fprintf(receipt, "\n\nEnd of Receipt.");
      fclose(receipt);
  
      return 0;
  }
  </code></pre>
  
  <p>I've tried throwing in</p>
  
  <pre><code>if(!receipt) {
      printf("Error!");
  }
  else {
      fprintf(blabla);
  }
  </code></pre>
  
  <p>But to no avail.</p>
  
  <p>It simply does not create the file :/ Running in Xcode and on Mac. No warnings/notices or otherwise stuff to give me any idea of what is wrong.</p>
  
  <p>*I tried adding <code>system("pwd")</code> to figure out if it didn't save it where it should save it, but I have a hard time actually finding that directory (I don't know if it's temp, but even so the file should be there?). Obviously I wasn't questioning the actual validity of the library, duh, implicit that it was the <code>fopen</code> I was using not giving me what I expected?</p>
  
  <p>I can't make perror give me any useful information. Everything would appear to work as it should; I just don't get a file. Please avoid any more smartass comments, if you don't want to help just don't write.*</p>
  
  <p>Also, I removed all code, but the actual <code>fopen()</code> and <code>fprintf()</code>.</p>