in_stream.open("data.txt");
cout<< "data.txt: ";
if(in_stream.is_open()==true){
while(in_stream.eof()==false){
getline(in_stream,file_data);
}
cout<< file_data;
in_stream.close();
}
and this doesn't
in_stream.open("data.txt");
cout<< "data.txt: ";
if(in_stream.is_open()==true){
while(in_stream.eof()==false){
getline(in_stream,file_data);
cout<< file_data;
}
in_stream.close();
}
The top one successfully displays whatever is in the file while the second one doesn't display it. My question is, why?
also I don't know why the indenting got messed up but I'm not going to fix it lol
Thanks in advance!

New Topic/Question
Reply




MultiQuote




|