+ -
当前位置:首页 → 问答吧 → c++文件输入流问题

c++文件输入流问题

时间:2011-12-09

来源:互联网

当我用getline函数把一行字符读入字符数组中时,如何确定实际读入的字符数。

作者: zhanglingkangk   发布时间: 2011-12-09

作者: mougaidong   发布时间: 2011-12-09

读完了,自己统计

作者: mougaidong   发布时间: 2011-12-09

引用 2 楼 mougaidong 的回复:

读完了,自己统计

怎么统计

作者: zhanglingkangk   发布时间: 2011-12-09

C/C++ code

istream& getline( char* pch, int nCount, char delim = '\n' );

Remarks

Extracts characters from the stream until either the delimiter delim is found, the limit nCount–1 is reached, or end of file is reached. The characters are stored in the specified array followed by a null terminator. If the delimiter is found, it is extracted but not stored.



作者: dic_008   发布时间: 2011-12-09

C/C++ code

istream& getline( char* pch, int nCount, char delim = '\n' );
n=strlen(pch);//n就是个数

作者: neolyao   发布时间: 2011-12-09