Jul 23, 2013 at 8:49am UTC
case 9:
show_in_out_info();
break;
}
getch();
}
void input_student_info()
{
do
{
cout<<"enter record of student"<<endl;
cout<<"enter student_id:"<<endl;
cin>>s_id[i].id;
cout<<"enter name:"<<endl;
cin>>s_id[i].name;
cout<<"enter room_no:"<<endl;
cin>>s_id[i].room_no;
cout<<"enter department:"<<endl;
cin>>s_id[i].department;
cout<<"enter cell.no:"<<endl;
cin>>s_id[i].cell_no;
cout<<"<_____address of student_____>"<<endl;
cout<<"enter country_name:"<<endl;
cin>>s_id[i].d;
cout<<"enter province_name:"<<endl;
cin>>s_id[i].d;
cout<<"enter city_name:"<<endl;
cin>>s_id[i].d;
cout<<"enter street:"<<endl;
cin>>s_id[i].d;
cout<<"enter street_no:"<<endl;
cin>>s_id[i].d;
cout<<"enter h_no:"<<endl;
cin>>s_id[i].d;
cout<<"do u want to enter another record(y/n)?"<<endl;
cin>>ch;
}
while(ch=='y'|| ch=='Y');
}
its a part of my program not the complete program.
Jul 23, 2013 at 8:54am UTC
Do you get an error message? Post it here.
Does it not work as ju expected? What does the program do and what did you expect?
Jul 23, 2013 at 8:54am UTC
I see nothing wrong in this do-while loop except that variable 'i' is not changed. So in the next iteration you will fill the same objects.
Jul 23, 2013 at 8:58am UTC
no there is no error ... it only displays the function once only
Jul 23, 2013 at 8:59am UTC
my program is on microsoft visual c++ 6.0
Jul 23, 2013 at 9:00am UTC
You did not show how ch is defined. If it is defined as int when there will be an input error and ch never will be equal 'y' or 'Y'. ch shall be defined as char.
Last edited on Jul 23, 2013 at 9:01am UTC