错误C2248。 Visual Studio 2010 [英] Error C2248. Visual Studio 2010

查看:114
本文介绍了错误C2248。 Visual Studio 2010的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到此错误,虽然我没有在我的代码中使用任何类。我认为我的问题在那里但不确切知道它是什么

void openFile(ifstream infile,int ** matrix,int y,int x){...

mstrix [y] [x] = atoi(a_string.cstr())...

I get this error although i haven t used any classes in my code. i think that my problem is there but don t know exactly what it is
void openFile(ifstream infile,int **matrix,int y,int x){...
mstrix[y][x]=atoi(a_string.cstr())...

推荐答案

您使用了类:a_string.cstr()。



评论所有代码,直到你找到这个地方。你的编译器应该对它抱怨的那一行大喊大叫....



其他人有类似问题
you have used classes: a_string.cstr().

Comment all code out til you find the place. Your compiler hould yell on which line it is complaining....

Somebody else had similar problems,


如果它正在抱怨ios或iosbase的拷贝构造函数无法访问这是复制造成问题的ifstream。尝试通过引用传递流,或者,为了在调试和测试中的合理性,将其作为对istream的引用传递。



如果该批次听起来像世界语然后在标准库中获取教科书并查找引用,复制构造和iostream类。
If it's whinging about the copy constructor of ios or iosbase being inaccessible it's the copying of an ifstream that's causing the problem. Try passing the stream by reference, or, for the sake of sanity in debugging and testing, pass it as a reference to an istream.

If that lot sounds like Esperanto then grab a textbook and lookup references, copy construction and the iostream classes in the standard library.


这篇关于错误C2248。 Visual Studio 2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆