开发者

getline() error. no instance of overloaded function matches argument list.

开发者 https://www.devze.com 2023-04-07 01:30 出处:网络
Hi i am tr开发者_如何学JAVAying to use getline() function by giving two arguments to it. but it is giving error as no instance of overloaded function matches argument list.

Hi i am tr开发者_如何学JAVAying to use getline() function by giving two arguments to it. but it is giving error as no instance of overloaded function matches argument list.

Here is my code snippet:

    string equation;
    cout<<"Enter the string";
getline(cin, equation);

can anyone please tell me if i am missing something.

Thanks.


There is probably another function called getline which takes different arguments. To use the one you want, you have to

#include <iostream>
#include <string>

and either use

using namespace std;

or explicitly put std:: before string, cout, cin and getline.

0

精彩评论

暂无评论...
验证码 换一张
取 消