Suquentially "searching" two arrays.

asd
Last edited on
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!
asd
Last edited on
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.