相关疑难解决方法(0)

"左值作为赋值的左操作数"需要"错误"

以下代码生成"作为赋值左操作数所需的左值"

if( c >= 'A' && c <= 'Z'  || c = " " || c = ",") {
Run Code Online (Sandbox Code Playgroud)

我假设我写错了,出了什么问题?我怎么写得正确?

c

3
推荐指数
1
解决办法
3万
查看次数

C++代码无法正常工作

我是StackExchange的新手,但我有一个简单的类,当我运行它时似乎没有返回正确的结果.这是代码:

#include <iostream>

using namespace std;

int thisIsHowYouIfLikeABoss2(int, int);

int main()
{
     cout << "One." << endl;
     thisIsHowYouIfLikeABoss2(9, 9);
     cout << "Two." << endl;
     thisIsHowYouIfLikeABoss2(4, 9);
    return 0;
}

 int thisIsHowYouIfLikeABoss2 (int x, int y)
 {
    cout << "Welcome to the thisIsHowYouIfLikeABoss(), where I calculate if x = y easily." << endl;
    if (x = y)
    {
        cout << "X is Y." << endl;
    }
    if (x != y)
    {
        cout << "X is not Y" << endl;
    }
} …
Run Code Online (Sandbox Code Playgroud)

c++

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

标签 统计

c ×1

c++ ×1