int main(){
char* name;
int num;
string s ;
name = newchar[20];
ifstream fin;
fin.open("students.dat",ios::in);
if(!fin.good())
cout<<"problem\n";
else
cout<<"fine";
fin>>num; \\first line in the file is number of lines
cout<<num<<"number of record";
while(!fin.eof()){
cout<<"miracle";
getline(fin,s);
cout<<s;
}
return 0;
}
if i put cin.ignore(); before getline the out put wait for the enter and after entering appear....On the other hand, if i put \n in the end of cout<<"miracle"; half of the things come out....why?
thanks any one if explain what's happening when file is reading and the enter and cin.ingnore() what are doing over there?!....