这里是c++的语法,创建file的引用,而不是指针。
CSstdiofile对文件频繁读写的优化方法
https://bbs.csdn.net/wap/topics/200035733
这里一位网友提到一段代码
static CStdioFile g_file;
functionB()
{
//CStdioFile& file = g_file;
//file.Open();
...;
//file.Close();
}
functionA()
{
...;
g_file.Open();
while(...)
{
functionB();
}
g_file.Close();
}
其中stdiofile &file=g_file;
这句怎么理解?不应该是stdiofile *file=&g_file;这样的吗
- 点赞
- 写回答
- 关注问题
- 收藏
- 复制链接分享
- 邀请回答
1条回答
为你推荐
- CSstdiofile对文件频繁读写的优化方法 2
- c++
- 2个回答
- CSstdiofile对文件频繁读写的优化方法
- 文件操作
- cfilen
- stdiofile
- open
- close
- 1个回答