| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 645 人关注过本帖
标题:指针定位问题
只看楼主 加入收藏
guang
Rank: 4
来 自:广东深圳
等 级:贵宾
威 望:13
帖 子:1414
专家分:285
注 册:2006-4-3
结帖率:100%
收藏
 问题点数:0 回复次数:5 
指针定位问题
在文件中好像有个指针定位的函数的,不过我不记得是什么了,各位可否说下它的用法?不胜感激!
搜索更多相关主题的帖子: 指针 
2006-06-08 16:20
Bekky
Rank: 3Rank: 3
等 级:新手上路
威 望:7
帖 子:354
专家分:0
注 册:2006-5-29
收藏
得分:0 
seek();

我的编译环境为WinXp + VC 6.0 http://blog..cn/yobo
2006-06-08 17:39
guang
Rank: 4
来 自:广东深圳
等 级:贵宾
威 望:13
帖 子:1414
专家分:285
注 册:2006-4-3
收藏
得分:0 
怎么用呀,可不可以举个例子说明下?

不相信未作牺牲竟先可拥有,只相信靠双手找到我的欲求!!
我的博客:http://liao5930.blog.
2006-06-08 19:46
guang
Rank: 4
来 自:广东深圳
等 级:贵宾
威 望:13
帖 子:1414
专家分:285
注 册:2006-4-3
收藏
得分:0 

出现一个错误:
error C2065: 'seek' : undeclared identifier
怎么回事?


不相信未作牺牲竟先可拥有,只相信靠双手找到我的欲求!!
我的博客:http://liao5930.blog.
2006-06-08 19:49
Bekky
Rank: 3Rank: 3
等 级:新手上路
威 望:7
帖 子:354
专家分:0
注 册:2006-5-29
收藏
得分:0 

以下为MSDN里的帮助:
CFile::Seek

virtual LONG Seek( LONG lOff, UINT nFrom );
throw( CFileException );

Return Value

If the requested position is legal, Seek returns the new byte offset from the beginning of the file. Otherwise, the return value is undefined and a CFileException object is thrown.

Parameters

lOff

Number of bytes to move the pointer.

nFrom

Pointer movement mode. Must be one of the following values:

  • CFile::begin Move the file pointer lOff bytes forward from the beginning of the file.

  • CFile::current Move the file pointer lOff bytes from the current position in the file.

  • CFile::end Move the file pointer lOff bytes from the end of the file. Note that lOff must be negative to seek into the existing file; positive values will seek past the end of the file.

Remarks

Repositions the pointer in a previously opened file. The Seek function permits random access to a file’s contents by moving the pointer a specified amount, absolutely or relatively. No data is actually read during the seek.

When a file is opened, the file pointer is positioned at offset 0, the beginning of the file.

Example

//example for CFile::Seek
extern CFile cfile;
LONG lOffset = 1000, lActual;
lActual = cfile.Seek( lOffset, CFile::begin );

我的编译环境为WinXp + VC 6.0 http://blog..cn/yobo
2006-06-09 08:46
行空天马
Rank: 1
等 级:新手上路
威 望:1
帖 子:523
专家分:0
注 册:2006-5-19
收藏
得分:0 

我记得还可以

SeekToBegin();

以及

SeekToEnd();


好好学习,天天向上。
2006-06-09 10:31
快速回复:指针定位问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018973 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved