非典型性错误,大家看看!!!谢了,先!

point_to 2003-04-23 08:43:50
http://expert.csdn.net/Expert/topic/1692/1692175.xml?temp=.7468225
...全文
29 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
woxihuanbohe 2003-04-23
  • 打赏
  • 举报
回复
我想这个本身不是错误,可能是模版类的实例化的时候出错了!
point_to 2003-04-23
  • 打赏
  • 举报
回复
template<typename Type>
class Matrix
{.....
void WritetoFile(ofstream &fout)//int i
{ ....}
.......
}
函数WritetoFile不能把输出文件流类对象ofstream &作为参数(换成string也不行,注:和头文件没有什么联系),但是换成int或者其他的基本类型,就好好的!
还有一点,把ofstream的对象放在函数体内也是可以得!为什么??
错误信息是:
error C2061: syntax error : identifier 'ofstream'

69,382

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧