*this is just a chunk of the code. the others arent that important
what the program is supposed to do:
- asks the user for a title.
- searches the array if its in it or not
i already declared all the index, title, etc. as global variables.
the text in the file is like this:
1 < -- index \
abc < -- title \
def < -- author \
hi hi <-- descrip 500 times
125 <-- isbn /
13 <-- copies /
2 <-- checked /
ifstream file;
file.open("Final.txt"); //opens the file
string userTitle;
while (file.good())
{
for (int x = 0; x < 500; x++) //idk about this part lol. hope
{ //its right
file >> index[x];
file >> title[x];
file >> author[x];
file >> description[x];
file >> ISBN[x];
file >> copies[x];
file >> checked[x];
}
}
cout << "Please enter a title: " << endl; //asks the user for a title
cin >> userTitle;
cin.get();
// need help ovaah hurr. S.O.S D:
// ...
cout << "Please enter a title: " << endl;
cin >> userTitle;
cin.get(); // not sure why you need this line
for (int x = 0; x < 500; x++)
{
if(userTitle == title[x])
{
}
}
Side note: Next time when you ask a question, please explain what you're having trouble with in more detail. Be as verbose as possible.