Suquentially "searching" two arrays.

Jul 28, 2010 at 11:49pm
asd
Last edited on Jul 29, 2010 at 2:04am
Jul 29, 2010 at 12:57am
The arrays are of the same size and you are inserting the pair of items into the same element of each relative to the start. The problem is that you are overwriting the item array which makes no sense. Why would you do that? You aren't doing a lookup at all. Also what is i set to at the time that ask for the product look up?

First you need to amend the first loop to do bounds checking. It shouldn't allow more than 100 entries. Second you need to read the item to look up into a temporary string object. Then you need to search the item array and determine if the product was found. Good luck!
Jul 29, 2010 at 1:02am
asd
Last edited on Jul 29, 2010 at 2:04am
Jul 29, 2010 at 1:28am
xcrossmyheartx wrote:
How would I do this?


1
2
3
	std::string search;
	cout << "Enter a product to look up: ";
	getline(cin, search);
Topic archived. No new replies allowed.