Hi, I'm trying to figure out how classes work. I currently am working on getting a class to read a string and then place it into an array, as well as have the class then output the entire array. I wrote the following code to make sure i could get it working without a class, but now I don't know how to continue.
int main(void)
{
int hold = 0;
string table[MAX_ARRAY_SIZE];
string word;
cout<<"This code will take in 15 words and store them based on a hash function."<<endl;
for(int c ount = 0; count < MAX_ARRAY_SIZE; count++)
{
table[count] = "?";
}
for(int count = 0; count < 15; count++)
{
getline(cin, word);
hold= ((word[0] + word[word.size()-1])% MAX_ARRAY_SIZE);
table[hold] = word;
}
cout<<endl;
for(int count = 0; count < MAX_ARRAY_SIZE; count++)
{
cout<<table[count]<<endl;
}
}