title: How To Change Path of a File At Runtime In C?
body: <p>I Have To Change The Path Given by An Macro of The Custom Header Files At Runtime.
  Suppose That I Have a Directory Where All My Custom Data Structures are Stored
  <code>Path: E:\Programming Files\Code\C\Custom Headers</code> The <code>Custom Headers</code> Folder Has Some SubFolders, My Directory WorkFlow Is Like That:</p>
  <pre><code>Custom Headers
        |
        |&gt; Array Structure
        |       |
        |       |&gt; Integer_Array.c
        |       |
        |       |&gt; Float_Array.c
        |       |
        |       |&gt; Char_Array.c
        |       |
        |       |&gt; Arrays.h
        |
        |&gt; Stack Structure
        |       |
        |       |&gt; Integer_Stack.c
        |       |
        |       |&gt; Float_Stack.c
        |       |
        |       |&gt; Char_Stack.c
        |       |
        |       |&gt; Stack.h
        |
        |&gt; Queue Structure
        |       |
        |       |&gt; Integer_Queue.c
        |       |
        |       |&gt; Float_Queue.c
        |       |
        |       |&gt; Char_Queue.c
        |       |
        |       |&gt; Queue.h
        |
        |&gt; Structures.h
        |
  </code></pre>
  <p>In <code>Arrays.h</code>, <code>Stack.h</code> &amp; <code>Queue.h</code> The Paths of Structures Are Defined. For Example, In <code>Arrays.h</code> File:</p>
  <pre><code>#define Int_Array &quot;E:\Programming Files\Code\C\Custom Headers\Array Structure\Integer_Array.c&quot;
  #define Float_Array &quot;E:\Programming Files\Code\C\Custom Headers\Array Structure\Float_Array.c&quot;
  #define Char_Array &quot;E:\Programming Files\Code\C\Custom Headers\Array Structure\Char_Array.c&quot;
  </code></pre>
  <p>Just Like That <code>Stack.h</code> and <code>Queue.h</code> Files Are Also Written. And The Final One Is <code>Structures.h</code>:</p>
  <pre><code>#define Array &quot;E:\Programming Files\Code\C\Custom Headers\Array Structure\Arrays.h&quot;
  #define Stack &quot;E:\Programming Files\Code\C\Custom Headers\Stack Structure\Stack.h&quot;
  #define Queue &quot;E:\Programming Files\Code\C\Custom Headers\Queue Structure\Queue.h&quot;
  
  #include Array
  #include Stack
  #include Queue
  </code></pre>
  <p>With These Files, I made Connection Network Through Out The Directory. Beucause Of It, I Can Able To Include All Structures in The <code>Custom Headers</code> Folder Without Giving Address. For Example:
  <code>Example.c</code> (File Present In Other Directory) :::</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &quot;E:\Programming Files\Code\C\Custom Headers\Structures.h&quot;
  #include Int_Array
  #include Int_Stack
  #include Int_Queue
  
  int main()
  {
    printf(&quot;Hello World!&quot;);
    return 0;
  }
  </code></pre>
  <p>This Is Just For Simplicity When Including My Structures at any File in Need.</p>
  <p>But The <strong>Problem</strong> is That I Cannot Modify The Paths At Ones For Any Case.
  Is There Any Solution To Change All Paths When I include The <code>Structures.h</code> File.
  <code>Problem.c</code>:</p>
  <pre><code>#include &lt;stdio.h&gt;
  #define ROOT_PATH &quot;E:\Programming\C&quot; \\Is There Any Thing Like This Can Modify The Value of All Defined Macros.
  #include &quot;E:\Programming Files\Code\C\Custom Headers\Structures.h&quot;
  
  int main()
  {
    return 0;
  }
  </code></pre>