小编YWH*_*YWH的帖子

ISO C++禁止在C++代码中比较指针和整数[-fpermissive]

我的代码有问题.它始终返回错误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)

c++ pointers

0
推荐指数
1
解决办法
1060
查看次数

标签 统计

c++ ×1

pointers ×1