recall values from a loop

hey guys,

bit of a brain fart, i have a program that asks a user to into input how many item prices theyd like to enter, then it asks for each individual price. how do i go about being able to recall each individual price later in my program:

i.e

enter price 1: 30
enter price 2: 46

then later:

the price of item 1: 30
the price of item 2: 46

heres the snipit of code that should be affected:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
do
	{
	
		count = 0;
		cout<<"How many sales items do you have? :";
		cin>>items;
		
	while ( count < items)
	{
		cout<<"Enter the value of the sales item "<<item_count<<" : $";
		cin>>price;
		total = total + price;
		count ++;
		item_count++;
	}
now that i think about it...i might just use an array..
Topic archived. No new replies allowed.