fstream readStringBF;
readStringBF.open("Name.dat", ios::in | ios::binary);
char n[30];
if (readStringBF.is_open()) {
readStringBF.read(n, 30);
n[readStringBF.gcount()] = NULL; //append string terminator
cout << n;
readStringBF.close();
}
else cout << "Unable to open file!";