在Vc++ 中file.GetPosition()函数的意思是什么?file对应打开一个文件的句柄.. 小白求教~

如题所述

LONGLONG lOffset = 1000; //定义文件操作指针 的位置
ULONGLONG lActual;
lActual = cfile.Seek(lOffset, CFile::begin);//设置文件 写读操作位置指针。返回当前设置的位置
ASSERT(cfile.GetPosition() == lActual);//获得当前的操作位置 == 刚刚移动指针返回的值。

也就是如果你移动 位置到10字节 他就从10字节的后面开始写入和读取。
GetPosition() 是获得当前操作文件 写入读取的操作位置。
上面函数证明了他的过程
温馨提示:答案为网友推荐,仅供参考
第1个回答  2012-02-13
返回文件中当前位置
File.getPosition
Retrieves the current position of this file.
public long getPosition()
Return Value
Returns the current position of the file.
相似回答