C++: Using ifstream with getline();

前端 未结 4 1804
名媛妹妹
名媛妹妹 2021-02-03 12:34

Check this program

ifstream filein(\"Hey.txt\");
filein.getline(line,99);
cout<

        
4条回答
  •  故里飘歌
    2021-02-03 12:42

    As Kerrek SB said correctly There is 2 possibilities: 1) Second line is an empty line 2) there is no second line and all more than 1000 character is in one line, so second getline has nothing to get.

提交回复
热议问题