PROBLEM WITH PROGRAM in C++

Hello Everyone ! Can anyone help me with my program? When I assign a value to rate throught the function input_num(int&,int) and when I display the values of rate it gives me the the value 17.5 no matter what I enter.

Can anyone help out pls?
Here is the function:-
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
class STORE
	{
 		char itemname[20],type[10];
 		int itemno;
 		float rate;
 		int qty;
 		public:
 		void input();
 		void output();
      void display(int);
      intretno(){return itemno;}
      char*retname(){return itemname;}
      void sell(int,float&,float,char&);
      void modify();
   };
.
.
.
.
.
.
void STORE::input()
        {
        		int j=18;
        		int i=1;
            char res;
            cout<<"Enter the item name :";
            input_string(itemname,7);
            do
            	{
               	if(i==1)
                  {
                  	gotoxy(10,16);cout<<"Enter the equipment  number :";
                  }
         	else if(i>1)
            		{gotoxy(10,j++);cout<<"Enter another item number :";}
                  	input_num(itemno,4);
                     res=test(itemno);
                     if(res=='Y')
                     {
                     	gotoxy(10,j+1); cout<<"ITEM EXISTS";
                     }
            i++;
               }while(res=='Y');
               	gotoxy(10,j+2);cout<<"Enter the type of equipment  :";
               	input_string(type,7);
               	gotoxy(10,j+3);cout<<"Enter the rate of equipment :";
               	input_num(rate,5);

               	gotoxy(10,j+4);cout<<"Enter the quantity of equipment :";
              	   input_num(qty,3);
               }
You never set the value of itemno.
Topic archived. No new replies allowed.