我的代码有问题.它始终返回错误ISO C++禁止指针和整数[-fpermissive]之间的比较.你能帮我看看这里有什么问题以及如何解决?
#include <iostream>
using namespace std;
char x;
int main()
{
cout << "Welcome to the citation machine. What do you want to cite?" << endl;
cin >> x;
if (x == "book")
{
cout << "What is the name of the book?";
}
}
Run Code Online (Sandbox Code Playgroud)