Compare user input to infile data

I am having trouble trying to compare input from a user to data within an infile. My program is to create a cash register. When the user adds an item number to the cash register, the item number must be compared to the infile to determine if the item number exists. The infile is entered into a struct as such:

1
2
3
4
5
6
7
8
9
10
11
12
13
14

struct inventory

{
    public:

    int item_number;
    string item_description;
    int quantity_in_warehouse;
    int cost;
    int sell_price;

};



I am using an array of size 4 to enter the infile into:

1
2
3

inventory list[4];


I've have been trying for two days now so any suggestions or examples of how to do this would be appreciated. Thanks.
Topic archived. No new replies allowed.