title: C++ rename function not working with absolute path
body: <p>Part of my program needs to get a file path from the user and then move and rename said file.</p>
  
  <p>If I use the relative path like this:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
      int check;
      char oldname[] = "images//test_1.jpg";
      char newname[] = "images//test//test_2.jpg";
      check = rename(oldname, newname);
      if (check == 0)
          puts("Success");
      else
          perror("Failed");
      return 0;
  }
  </code></pre>
  
  <p>It works perfectly.</p>
  
  <p>But if I try to use the absolute path like this:</p>
  
  <pre><code>char oldname[] = "c://path//images//test_1.jpg";
  char nername[] = "c://path//images//test//test_2.jpg";
  </code></pre>
  
  <p>it fails and says "Failed: No such file or directory"</p>
  
  <p>I am sure its some silly mistake but no matter how many times I double check my file path and code I can't figure it out. Any suggestions would be greatly appreciated.</p>
  
  <p>Oh and if it makes any difference I'm working in linux.</p>