Returning to beginning of file after getline

前端 未结 3 534
你的背包
你的背包 2020-12-02 17:14

So i\'ve read all the lines from a file thusly

while (getline(ifile,line))
    {
        // logic
    }

Where ifile is an ifstream and line

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-02 17:45

    FYI: In my case, the order DID matter, thus

    1. clear
    2. seek

    otherwise the next getline operation failed (MSVC v120)

提交回复
热议问题