vector<string> rd_vec(fstream &f) { typename vector<string>::size_type sz; f.rd(sz); vector<string> re; re.reserve(sz); char* buf = new char[1024]; int bi = 0; for (typename vector<string>::size_type i=0;i<sz;++i) { bi = 0; do { f.read(buf+bi,sizeof(char)); } while (buf[bi++] != '\0' && bi != 1024); if (bi == 1024) throw runtime_error("The word is too long to read = =."); re.push_back(string(buf)); } return re; }