Section 15:
 15.1 Advantages of over ? 15.2 Understanding infinite loop when the input is invalid? 15.3 How can I get std::cin to skip invalid input characters? 15.4 How does that funky while (std::cin >> foo) syntax work? 15.5 Why does my input seem to process past the end of file? 15.6 Why is my program ignoring my input request after the first iteration? 15.7 Should I end my output lines with std::endl or '\n'? 15.8 How can I provide printing for my class Fred? 15.9 Using a printOn() method vs. a friend function? 15.1 How can I provide input for my class Fred? 15.11 Providing printing for an entire hierarchy of classes? 15.12 How can I open a stream in binary mode? 15.13 "Reopening" std::cin and std::cout in binary mode? 15.14 How can I write/read objects of my class to/from a data file? 15.15 Sending objects over a network? 15.16 Backslashes in filenames? 15.17 How to capture key presses before the ENTER key? 15.18 How to turn off screen echo on keyboard input? 15.19 How can I move the cursor around on the screen? 15.2 How can I clear the screen? 15.21 How can I change the colors on the screen? 15.22 How can I print the numeric value of a char or char*? Updated!
[15.16] Why can't I open a file in a different directory such as "..\test.dat"?

Because "\t" is a tab character.

You should use forward slashes in your filenames, even on operating systems that use backslashes (DOS, Windows, OS/2, etc.). For example:

#include <iostream>
#include <fstream>

int main()
{
#if 1
std::ifstream file("../test.dat");  // RIGHT!
#else
std::ifstream file("..\test.dat");  // WRONG!
#endif

...
}

Remember, the backslash ("\") is used in string literals to create special characters: "\n" is a newline, "\b" is a backspace, and "\t" is a tab, "\a" is an "alert", "\v" is a vertical-tab, etc. Therefore the file name "\version\next\alpha\beta\test.dat" is interpreted as a bunch of very funny characters. To be safe, use "/version/next/alpha/beta/test.dat" instead, even on systems that use a "\" as the directory separator. This is because the library routines on these operating systems handle "/" and "\" interchangeably.

Of course you could use "\\version\\next\\alpha\\beta\\test.dat", but that might hurt you (there's a non-zero chance you'll forget one of the "\"s, a rather subtle bug since most people don't notice it) and it can't help you (there's no benefit for using "\\" over "/"). Besides "/" is more portable since it works on all flavors of Unix, Plan 9, Inferno, all Windows, OS/2, etc., but "\\" works only on a subset of that list. So "\\" costs you something and gains you nothing: use "/" instead.