I am trying an example from Bjarne Stroustrup's C++ book, third edition. While implementing a rather simple function, I get the following compile time error:
error: ISO C++ forbids comparison between pointer and integer
What could be causing this? Here is the code. The error is in the if
line:
#include <iostream>
#include <string>
using namespace std;
bool accept()
{
cout << "Do you want to proceed (y or n)?\n";
char answer;
cin >> answer;
if (answer == "y") return true;
return false;
}
Thanks!