the loop runs infinte for the second ittiration
//attempt two to make the student data base the other way
// this program runs onlu once and does not hav any data base once u exit
#include<iostream>
#include<conio.h>
using std::cout;
using std::endl;
using std::cin;
int count=0;
class student
{
double m_roll[100],m_class[100];
char m_name[100],m_adress[100];
public:
void getdata(int count)
{
cout<<" enter the name"<<endl;
cin>>m_name[count];
}
void read_data(int count)
{
if (count==0)
{
cout<<"no data found";
}
for (int i=0;i<count;i++)
{
cout<<m_name[i];
}
}
};
int main()
{
int user_input=0;
student student1;
do
{
cout<<"enter a choice"<<endl;
cin>> user_input;
if(user_input==1)
{
student1.getdata(count);
count=count+1;
user_input=0;
}
else
if(user_input==2)
{
student1.read_data(count);
user_input=0;
}
}while (user_input!=4);
getch();
return(0);
}