I got error when compile the code, can anyone help me to see through.The question is:Ask the user to input the number of times he want to key in the record.After he key in the record, insert one of the word to search whether the word is inside the record.
sorry,since i m new here, i wonder how to make my code show in the line like others post?my error is like wat quirkyusername said: if(t==vector[i])
so wat should i do to compare the two?
Basically my program output will be like this:
Enter the number of times you want to key in:3
numbers[0]=bird
numbers[1]=cat
numbers[2]=dog
Enter a name to search:elephant
the record not found
As for your error... vector is an array of ints. You're comparing one of its elements to a string. That's not going to work properly unless you overload ==.