char buf[1024] = {0};
1.while (ifs>> buf){cout<< buf << endl ;}
2.while(ifs.getline(buf,sizeof(buf))){cout <<buf << endl};
3.string buf
while(getline(ifs,buf)){cout<< buf << endl;}
4.(不推荐)
char c;
while ((c= ifs.get())!= EOF){cout << c; }