title: How to put two backslash in C++
body: <p>i need to create a function that will accept a directory path. But in order for the compiler to read backslash in i need to create a function that will make a one backslash into 2 backslash.. so far this are my codes:</p>
  
  <pre><code>string stripPath(string path)
  {       
          char newpath[99999];
          //char *pathlong;
          char temp;
          strcpy_s(newpath, path.c_str());
          //pathlong = newpath;
          int arrlength = sizeof(newpath);
  
              for (int i = 0; i &lt;= arrlength ;i++)
              {
                  if(newpath[i] == '\\')
                  {
                      newpath[i] +=  '\\';
                      i++;
                  }
              }
              path = newpath;
          return path;
  } 
  </code></pre>
  
  <p>this code receives an input from a user which is a directory path with single backslash.
  the problem is it gives a dirty text output;</p>