开发者

getline() error. 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜