无法重置和移动指针 [英] unable to reset and move the pointer
问题描述
我在重置时遇到问题,无法使用c ++中的seekg()函数移动文本文件中的指针。该怎么办?
i have a problem in resetting and unable to move the pointer in the text file using seekg()function in c++. what to do ??
推荐答案
你检查seekg返回的内容以及文件中是否包含那么多字节...
raghu
R u checking what the seekg is returning and whether the file is having that much bytes in it...
raghu
R u检查seekg返回的内容以及文件是否有那么多其中的字节...
raghu
R u checking what the seekg is returning and whether the file is having that much bytes in it...
raghu
当我将其重置为起始点时由
file.seekg(0,ios :: beg);
之后通过file.tellg()显示这个数字4294967295
所以它没有重新安置,我不知道该怎么办。我的最大文件大小是65751180。
when i reset it to starting point by
file.seekg(0,ios::beg);
after this through file.tellg() it shows this number 4294967295
so it has not resetted, i don''t know what to do. my max file size is 65751180.
当我将它重置为起始点时
file.seekg( 0,ios :: beg);
之后通过file.tellg()显示这个数字4294967295
所以它没有重置,我不知道是什么去做。我的最大文件大小是65751180.
when i reset it to starting point by
file.seekg(0,ios::beg);
after this through file.tellg() it shows this number 4294967295
so it has not resetted, i don''t know what to do. my max file size is 65751180.
通常它的行为就像那样。
我尝试了一小段代码并打印了值正确的。
你能否发布一些关于你如何进行搜寻和告诉的代码?
Raghu
Usually it dosent behave that way.
I tried a small piece of code and it printed the value properly.
Can you post the piece of code on how u are doing the seek and tell?
Raghu
这篇关于无法重置和移动指针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!