注册 登录
编程论坛 C++教室

请教达人,关于fstream的。。。。

kongyuyu 发布于 2008-03-20 06:04, 668 次点击
ifstream里面有个函数 tellg() 怎么使用啊?
使用以后返回什么啊?
如果
ifstream in;
char ch;
cout<<in.tellg();
in.get(ch);
cout<<in.tellg();
in.get(ch);
cout<<in.tellg();
各输出些什么啊?

有没有更好的返回文档读取指针的函数啊?

还有,关于读取包含ASCII 26(end of file 标示符)的文档应该怎么写最好?
其实文档并没有完,只是中间有些ASCII 26,如果用正常的while(in)loop 那么读到26就不往下读了,求解!

[[it] 本帖最后由 kongyuyu 于 2008-3-20 06:25 编辑 [/it]]
2 回复
#2
kongyuyu2008-03-20 13:27
为什么没有人能回答呢。。。。
自己踩踩。。。免得沉了!!
#3
eagleboycn2008-03-21 14:59
pos_type tellg();

The tellg() function is used with input streams, and returns the current "get" position of the pointer in the stream.
1