this is my program and every time shows me this error:18 26 :: [Error] statement cannot resolve address of overloaded function::

    #include <iostream>
     using namespace std;

     int pow(int a,int b);
     int mabna(int n, int k){
        int a,b,s=0 ;
           for(int i=0;i!=0;i++){

            s=(a%b)*pow(10,b);
            s+=(a/b)*b;
            return s;}
}
     int main (){
            int a1,a2, a3,a4,n1,n2,n3,n4;
            int pow(int a,int b);
            cin>>a1>>a2>>a3>>a4;endl;
            n1=mabna(a1,a2);
            n2=mabna(a1,a3);
            n3=mabna(a1,a4);
             cout<<n1<<n2<<n3;
}

Recommended Answers

All 3 Replies

You seem to be trying to declare a function, pow, twice. You also never define it.

Anyway, it's complaining about this line:
cin>>a1>>a2>>a3>>a4;endl;
What is that endl for?

thank u ! but Iwant to print my n1,n2,...,n4 in difrent line and then I write "endl"

If you want to output, use cout.
If you want to input, use cin.

cin >> a1;
cout << endl;
cin >> a2;
cout << endl;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.