I'm working on a program that requires me to create a hash table from the contents of a file. The file contains records (1 per line) that include a key (int), name (string), code (int), and a cost (double). I have the code written for most of the program to create the hash table, however, I'm having some trouble figuring out how I should load the table from the file. More specifically, how to store each piece of the record into its corresponding variable?
The code is kind of long, but if you think posting it would help answer my question, let me know and I'll be glad to include it.
I do feel I should include this though, I have a struct set up to hold the information contained in each record that I have set up as follows:
struct record {
int key;
string name;
int code;
double cost;
}
If you need to see any other portions of the code, or the code as a whole, let me know.