| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
共有 1542 人关注过本帖
标题:这个错误是为啥?怎样改正?
取消只看楼主 加入收藏
冷月·葬花魂
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2017-12-10
结帖率:75%
收藏
 问题点数:0 回复次数:0 
这个错误是为啥?怎样改正?
d:\专业\vc6\myprojects\行文本编辑器\行文本编辑器3\linklist.h(66) : error C2664: '__thiscall fstream::fstream(int)' : cannot convert parameter 1 from 'char [12]' to 'int'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
        d:\专业\vc6\myprojects\行文本编辑器\行文本编辑器3\linklist.h(63) : while compiling class-template member function 'void __thiscall LinkList<char>::Showwenben(void)'
Error executing cl.exe.
代码如下
void Showwenben()//显示当前文本
    {
        cout<<"当前文本是:"<<endl;
        int i,j;
        fstream examplefile("example.txt");//错误行
        for(i=0;i<hang;i++)
        {
            
            for(j=0;j<lie;j++)
            {
                cout<<wenben[i][j];
                if (examplefile.is_open())
                {
                    examplefile<<"wenben[i][j]";
                    
                }
               
            }
            examplefile.close();
            cout<<endl;
        }
    }
};
2018-06-26 15:11
快速回复:这个错误是为啥?怎样改正?
数据加载中...
 
   



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

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017209 second(s), 9 queries.
Copyright©2004-2025, BC-CN.NET, All Rights Reserved