appending "../xx.txt" to the relative path does work in C++
<p>I read some topics about relative path, but I've been wandering around them for hours without answer.
   The code is like this:</p>

<pre><code>std::string path = "./Debug/";
path.append("../hi.txt/");
std::ifstream inFile(path);
std::string str;
if (inFile.is_open())
{
    inFile &gt;&gt; str;
    std::cout &lt;&lt; str &lt;&lt; std::endl;
}
else
{
    std::cout &lt;&lt; "open failed" &lt;&lt; std::endl;
}
</code></pre>

<p>This code will output:"open failed".
Any help would be appreciated.</p>