123456789
string path = "~/data/"; string file = path + "file.dat"; fstream f; f.open(file.c_str(), ios::in); if ( !f ) { cout << "I can't open " << file << "\n"; }
string path = "/home/nik/data/"; // my user directory