title: How Do I Set the Working directory on Code::Blocks on Mac?
body: <p>I am learning C programming so I'm a total beginner. </p>
  
  <p>I am using Code::Blocks 12.11 on Mac, I have got Xcode and downloaded the command line packages so everything seems to be doing what I want it to. </p>
  
  <p>My problem is when I open a .txt file it doesn't appear in the directory with the source code and other files, I have found it in the All My File folder in Finder. </p>
  
  <p>I am creating projects using the following steps > File > New > Project > Console Application > Then naming the Project and saving it to a File I  have created for all my programmes. </p>
  
  <p>All my previous projects are saved in neat folders in this directory except the .txt file. </p>
  
  <p>This is my code.</p>
  
  <pre><code>/**
  
  Automatic Control and Systems Engineering126 - Problem Sheet 2.Q2
  Project: Opening a Text File for Writting
  Author: Craig McAllister
  Date: 23.02.17
  
  **/
  
  #include &lt;stdio.h&gt;
  
  main()
  {
        FILE *myFile;
        myFile=fopen("first.txt","w"); // open first.txt for writing (or create it if it doesn't exist) - this will be in the same folder as the c program
        fprintf(myFile,"Hello World!!!\n");
        fclose(myFile);
  }
  </code></pre>
  
  <p>I read on another similar question that if I give it a direct path it will work and it has, to some extent; </p>
  
  <p><code>myFile=fopen("/Users/craigmcallister/Documents/CodeBlocks/First_Text/first.txt","w");</code></p>
  
  <p>this line of code saves the .txt file in the same project file that contains my source code which is a step closer to the solution I want. </p>
  
  <p>I would like .txt files to automatically save in the working directory the rest of the project is saved in and in this case for the .txt file to automatically open (if this is possible)?</p>
  
  <p>I suspect that my working directory is not set up properly but as I am very new to this, I have no idea what this would look like or how I would go about changing the settings. </p>
  
  <p>If any magician/wizard can help put an end to this pain I would be eternally grateful :)</p>