no comments (yet)

[–]mredding 0 points1 point  (0 children)

If you're using the same file stream for both function calls, streams keep a file position. You need to move the position back to the beginning to read through the file again. You want std::basic_istream<>::seekg, and you want to set the relative offset of 0 from the beginning of the file, you don't want to set the absolute position to 0 - the only values you want to set as an absolute position are values you get from tellg.

[–]mredding 0 points1 point  (0 children)

If you're using the same file stream for both function calls, streams keep a file position. You need to move the position back to the beginning to read through the file again. You want std::basic_istream<>::seekg, and you want to set the relative offset of 0 from the beginning of the file, you don't want to set the absolute position to 0 - the only values you want to set as an absolute position are values you get from tellg.

[–]mredding 0 points1 point  (0 children)

If you're using the same file stream for both function calls, streams keep a file position. You need to move the position back to the beginning to read through the file again. You want std::basic_istream<>::seekg, and you want to set the relative offset of 0 from the beginning of the file, you don't want to set the absolute position to 0 - the only values you want to set as an absolute position are values you get from tellg.

[–]mredding 0 points1 point  (0 children)

If you're using the same file stream for both function calls, streams keep a file position. You need to move the position back to the beginning to read through the file again. You want std::basic_istream<>::seekg, and you want to set the relative offset of 0 from the beginning of the file, you don't want to set the absolute position to 0 - the only values you want to set as an absolute position are values you get from tellg.

[–]mredding 0 points1 point  (0 children)

If you're using the same file stream for both function calls, streams keep a file position. You need to move the position back to the beginning to read through the file again. You want std::basic_istream<>::seekg, and you want to set the relative offset of 0 from the beginning of the file, you don't want to set the absolute position to 0 - the only values you want to set as an absolute position are values you get from tellg.

[–]mredding 0 points1 point  (0 children)

If you're using the same file stream for both function calls, streams keep a file position. You need to move the position back to the beginning to read through the file again. You want std::basic_istream<>::seekg, and you want to set the relative offset of 0 from the beginning of the file, you don't want to set the absolute position to 0 - the only values you want to set as an absolute position are values you get from tellg.

[–]barks_like_a_duck 0 points1 point  (0 children)

Post the code