当你遇到错误消息 "[error] no matching function for call to 'std::basic_istream<char>::getline'" 时,这通常意味着你在调用 std::getline 函数时提供的参数与函数期望的参数不匹配。以下是一些可能导致这种错误的原因及解决方法: 参数数量不匹配: std::getline 函数通常需要两个参数:一个输入流对象和一个...
error: no matching function for call to 'std::basic_ifstream<char>::open(std::string&) 原因是C++的string类无法作为open的参数。 解决方案:使用C的字符串。 例: char filename[10]; strcpy(filename, "1.txt"); ifstream fin; fin.open(filename);...
D:\QT_Project\SuoLuePics\mainwindow.cpp:16: error: no matching function for call to 'QGraphicsView::setScene(QGraphicsScene&)'..\mainwindo
no matching function for call to 'CDate::CDate()'你需要在CDate中定义参数为空的构造函数 SB(){};当调用这个构造函数的时候,成员CDate也会调用参数为空的构造函数,因为没有定义,所以报错了,你需要在类CDate中加上 CDate(){}
Qt同名信号error: no matching member function for call to ‘connect‘解决方法,文章目录1错误呈现2原因3解决1错误呈现原始代码connect(ui->SpinBox1,&QSpinBox::valueChanged,ui->Sli
{ public:void Print();CPerson(int a, const char *b); //必须公有,要带参数 private:int age;char name[50]; // 若用 *name,则要加动态分配存储空间 };CPerson::CPerson(int a, const char *b){ age=a; strcpy(name,b);} //传递参数 void CPerson::Print(){ co...
error: no matching function for call to `getline(char[51], std::string&)' Mar 1, 2010 at 1:15pm Xycose(1) I'm working on an assignment for my computer science class. I was able to use an input file to store data into three separate arrays, and then I realized when I reread ...
for(int i=0;i<2;i++){ cin>>urc[i] ;} Myarea.s(); return 0;}编译通过不了 报错为error: no matching function for call to 'Rectangle::s'请大神可以告诉我哪里的问题 应该怎么改 新手求教 请详细点回答 谢谢 展开 我来答 分享 新浪微博 QQ空间 举报 可选中1个或多个下面的关键词,...
s = new Ship[s->length];是创建了一个Ship对象数组,这时候会调用Ship的构造函数,对Ship进行初始化,此时调用的是无参的构造函数,但是你的程序中没有这样的够构造函数,所以出错了。解决办法:1、在Ship类中,添加无参构造函数。2、在创建对象数组时,创建有参数的。
看别人的:error: no matching function for call to 'std::basic_ifstream<char>::open(std::string&) 原因是C++的string类无法作为open的参数。 同样,可以发现是fileName的类型不对,没有匹配上。 QString fileName; ifstream i_f_stream(fileName,ifstream::binary); ...