简体   繁体   中英

Invalid operands of types long long int and unresolved overloaded function type to binary operator+

I am writting a simple experimental code in c++. But not able to figure out why is it giving me this error. Below is my code:

#include <bits/stdc++.h>
using namespace std;

int main(){
    long long m = 100006L;
    long long ans = 243343435L;
    long long inv = 123455677L;
    long long x = 0L;
    bool succcess = false;

    for(long long p = 1L; p<10000000;p++){
        if((m*p + ans) % inv == 0 ){
            succcess = true;
            x = ((m*p) + remainder) / inv;
            break;
        }
    }

    return 0;   
}

你没有声明命名一个局部变量remainder ,所以编译器认为你是指标准的remainder()由于包含的是非标准的功能(即可见bits/stdc++.h头,它包括一切和厨房水槽),因此出现奇怪的错误消息( remainder有几个重载,因此名称本身就是“未解析的函数类型”)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM