/* GOLDFISH CLUB early stage example test program */ #include #include #include #include #include const int MAX_NUM_ENTRIES = 500; string database[MAX_NUM_ENTRIES]; int num_entries=0; void read_data(string filename) { ifstream file(filename.c_str()); if (file.bad()) { cerr << "** Can't read the file '" << filename << "'\n"; exit(1); } num_entries=0; while (1) { if (num_entries>=MAX_NUM_ENTRIES) { cerr << "** File Too Long! Buy The Upgrade!!! **\n"; exit(1); } getline(file, database[num_entries]); if (file.eof()) break; num_entries+=1; } cout << "[" << num_entries << " entries read]\n"; } void print_data() { cout << "[printing all " << num_entries << " entries]\n"; for (int i=0; i