title: C code working only in one project, not in any new (won't write txt file)
body: <p>I have this very simple C code, which is supposed to create a .txt file and write to it.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
      FILE* f;
      if ((f = fopen("asdTEST.txt", "w")) == NULL) {
          printf("Failed to open.\n");
          return 1;
      }
      else {
          fprintf(f, "Hello\n");
          fclose(f);
          printf("Success!\n");
      }
      return 0;
  }
  </code></pre>
  
  <p>My problem is, it doesn't do it, when I compile it in Visual Studio 2019. What's strange - it does work in one project, but if I create a new one and copy-paste the code there, it won't create the file. However, it will end with code 0 as if it was successfull. If I run the compiled binary as an Administrator, it works just fine.</p>
  
  <p>(in the one successful project it creates the .txt file in the directory, where the source code .c is located, and that's what I want it to do)</p>
  
  <p>My question is - why the same code works in one VS project and not in other (new) ones ? What can I do to fix this ?</p>
  
  <p>Thank you!</p>