I have the following code:
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
int main() {
// your code goes here
stringstream instream("a x b c d x c d");
string line;
bool loop;
loop = getline(instream, line);
return 0;
}
It works on gcc, but when I compile using Visual Studio 2013 I get the build error at loop = getline(instream, line):
cannot convert from 'std::basic_istream<char, std::char_traits<char> > to 'bool'
How do I fix this problem?