0

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;
}
2
Contributors
3
Replies
25
Views
2 Years
Discussion Span
Last Post by Moschops
1

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?

Edited by Moschops

0

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

1

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

cin >> a1;
cout << endl;
cin >> a2;
cout << endl;

Edited by Moschops

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.