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
.
精彩评论